Summary: | Capturing a PR for optimized classloading | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Andrew Clement <aclement> | ||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Mac OS X | ||||||
Whiteboard: | |||||||
Attachments: |
|
Created attachment 283678 [details] patch Raised as a PR on the AspectJ in github that I can't process but I don't want to lose the valuable work. As written there: --- In our project we found out that during the build up of the spring context the class loading takes a very long time. Root cause is the huge amount of file I/O during pointcut class loading. We are taking about ~250k file loads. With these changes we managed to cut down the starting time by around 50%. What we found out is that IMHO - the clear method of the ClassLoaderRepository is called far too often -> in our settings this resulted in not a single cache hit as the cache got cleared permanently. Therefore we de-actived the cache clear calls inside the ClassLoaderRepository. Secondly we changed the Java15AnnotationFinder in a way to not always create new objects for the ClassLoaderRepository but re-use one static instance. Otherwise we experienced >100k objects being created. Last but not least we introduced a cache for unavailable classes so that they do not have to be looked up using file I/O over and over again. The whole behavior is configurable via org.aspectj.apache.bcel.useSingleRepositoryInstance (default: true) org.aspectj.apache.bcel.useUnavailableClassesCache (default: true) org.aspectj.apache.bcel.ignoreCacheClearRequests (default: true) ---