Summary: | [annotations] performance problem with @annotation(x) context extraction. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Simone Gianni <simoneg> | ||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | aclement | ||||
Version: | unspecified | ||||||
Target Milestone: | 1.6.7 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Simone Gianni
2009-11-30 10:34:01 EST
Created attachment 153350 [details]
Sample project, provided by Oliver Hoff, demonstrating the performance problem
Yes, when I looked at the generated code last night I came to the same conclusion as Simone. This stuff hasn't been reviewed since first being added in 1.5.0. Caching the annotation seems the best option for now. Just found this tag in the AspectJ source :D // OPTIMIZE cache result of getDeclaredMethod and getAnnotation? :D Changes are in to cache, it is quicker, but it is not as quick as the syntax for binding the string directly (see bug 296501). Numbers for 1,000,000 iterations: Manually fetching annotation with getAnnotation(): 645ms Binding annotation with @annotation(Marker): 445ms (was > 20seconds) Binding annotation value with @annotation(Marker(message)): 3ms fixed |