-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT Less cache fragmentation in ClassManifest #11533
Conversation
Can you please throw some benchmark numbers at me to help understand what the actual performance impact of this change is (either in terms of time or memory)? |
@GuySartorelli sure (that made me realize i was missing a line in my code^^) This is on a blank install on my machine (the files are stored on a regular hard drive, not a ssd, so that doesn't help and make the differences much more obvious) Without cache folder already created (initial warm up, or if clearing the whole cache directory) manifest: improved_manifest: With the cache already in place (and the enums fix applied, see my other PR, otherwise cache is not used) manifest: improved_manifest: With no surprise, creating hundreds of files on the hard drive takes a substantial amount of time on the first run. Having a in memory array also helps a lot. This comes at almost no performance cost since the whole "manifest" array end up loaded anyway, and it's larger than the file cache. This could certainly be improved even more (i don't see the need of having a separate file cache, the whole thing could fit in the same array) and the array could be optimized to avoid storing empty entries (which is, let's face it, most of it!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems very sensible, and thanks for the benchmark, makes it clear that this is a worthwhile improvement.
Just a small change to make.
This could certainly be improved even more (i don't see the need of having a separate file cache, the whole thing could fit in the same array) and the array could be optimized to avoid storing empty entries (which is, let's face it, most of it!)
That sounds like it'd be a good idea - but probably worth doing as a separate PR so this one doesn't end up getting blocked.
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll fix the commit message on merge.
Thanks!
I have to say I appreciate this ☀️. In different projects I have seen really good PRs just sit in the queue because an optional enhancement was requested and then the PR author got busy and it was never "finished", even though the PR by itself introduced great changes. So I appreciated the way you encouraged a separate PR for the optional change @GuySartorelli Great feature/enhancement PRs @lekoala! Thank you for your work |
Description
Reduce cache fragmentation by having only one entry for all cached files
Manual testing steps
Check number of files being created
BEFORE: 2k files
AFTER: 3 files
Issues
#11525
Questions
Should this target 6 ? for me, while this is technically a new "feature" it has only upsides and also "fixes" a performance issue
Pull request checklist