-
Notifications
You must be signed in to change notification settings - Fork 143
[MRESOLVER-68] Add cache around TrackingFileManager.getLock(File) #29
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
[MRESOLVER-68] Add cache around TrackingFileManager.getLock(File) #29
Conversation
rjatkins
commented
Mar 8, 2019
- Greatly speeds up Windows filesystem interactions
* Greatly speeds up Windows filesystem interactions
eolivelli
left a comment
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.
Interesting.
Can we add some test case?
* Opted to keep the no-args constructor for TrackingFileManager, so that DefaultUpdateCheckManager can continue creating throw away instances without any worries * Added a new configuration property for the TrackingFileManager fileLockCache maximum size, defaulting to 1024L
|
I've added some unit tests around the cache, and I'm refreshing the performance results with the new cache, with the (new) default maximum size of 1024 entries. Note that Guava's caches never get to that limit, but use some heuristics to remove LRU entries before the cache gets full - this is for cases when the cache is being populated in multiple threads, when the cache would otherwise spend a lot of time in each thread purging the oldest entries. |
|
In local testing on Windows 10 (using jprofiler), with a particularly pathological use of maven-enforcer-plugin in a project with 23 bannedDependencies rules, across more than 100 poms, with a tree depth of 4, build times to run This is when using maven-enforcer-plugin 3.0.0-M2, which happens to build a new dependency graph for each use of the bannedDependencies rule, so its performance is particularly bad for this project. I'm looking at also adding another higher level fix to that project that will speed things up considerably there too, although this performance fix in maven-resolver will still be valuable even after that's done. |
|
How does this one compare to #22? |
* Avoids a good deal of further redundant I/O
|
#22 adds full caching around all uses of the properties files tracked by TrackingFileManager, while this PR was focused only on the calculations of canonical paths, where the bulk of the time is spent in my local testing. Caching all properties reads will give further performance improvements - my testing shows another 130s saved on my worst case maven project. |
* Default to 1 minute, and allow configuration overrides with 1 second resolution
|
I believe that the |
|
Please evaluate: #67 |
|
Superseded by #67. |
|
Resolve #856 |
|
Resolve #1080 |
|
Resolve #856 |
|
Resolve #1080 |