Community
Participate
Working Groups
I am heavily using the runtime signature information from thisJoinPoint.getSignature() and the toString() method of it. This causes heavy String operations each time the toString method is called. Would it be possible to cache the resulting string for example in MethodSignatureImpl and similar classes for other signatures?
We will try to do this change after the benchmark suite is implemented so we will have a better grasp on the runtime performance gain and the static memory usage overhead of the change.
Matthew, do we have a suite to understand the possible footprint / performance trade-offs here? If this enhancement makes sense under test, then let's put it in...
The "toString()" cache will add a new reference to every Signature object. There are concerns about footprint in large systems: bug 59076. Therefore the reference must be shared by each of the toString implementations: short, middle, long. Also the cache must be soft so that GC can collect the String when no need. We should also endeavour to make this feature footprint-neutral by saving some memory elsewhere. Each SJP has a SourceLocation as well as a Signature. The column property is deprecated. Removing it and always returning -1 will save an "int".
Created attachment 14146 [details] toString caching 1. For Signature objects the results of to/toShort/toLongString are cached softly. 2. Simple testcase 3. Performance testcase 4. Redundant/deprecated "col" field removed from SourceLocation
Matthews code integrated. I will close the bug when it is available in a build.
fix available: BUILD COMPLETE - build.371 Date of build: 09/07/2004 12:33:43 Time to build: 101 minutes 39 seconds Last changed: 09/07/2004 11:47:45 Latest good AspectJ jar available at: download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Fix released as part of AspectJ 1.2.1