You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README-1.8.12.adoc 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. = AspectJ 1.8.12
  2. _© Copyright 2017 Contributors. All rights reserved._
  3. _Release info: 1.8.12 available 20-Oct-2017_
  4. This is a small release that includes a backport of some 1.9.0 work that improves the performance of Spring AOP (or any
  5. system consuming AspectJ in a similar way to Spring).
  6. Dave Syer recently created a series of benchmarks for checking the speed of Spring-AspectJ:
  7. https://github.com/dsyer/spring-boot-aspectj
  8. Here we can see the numbers for AspectJ 1.8.11 (on an older Macbook Pro):
  9. [source, text]
  10. ....
  11. Benchmark (scale) Mode Cnt Score Error Units
  12. StartupBenchmark.ltw N/A avgt 10 2.656 ~ 0.166 s/op
  13. StartupBenchmark.ltw_100 N/A avgt 10 2.618 ~ 0.063 s/op
  14. StartupBenchmark.spring v0_10 avgt 10 2.071 ~ 0.044 s/op
  15. StartupBenchmark.spring v1_10 avgt 10 2.210 ~ 0.058 s/op
  16. StartupBenchmark.spring v1_100 avgt 10 2.260 ~ 0.068 s/op
  17. StartupBenchmark.spring v10_50 avgt 10 2.933 ~ 0.039 s/op
  18. StartupBenchmark.spring v20_50 avgt 10 3.832 ~ 0.094 s/op
  19. StartupBenchmark.spring v20_100 avgt 10 3.959 ~ 0.047 s/op
  20. StartupBenchmark.spring a0_10 avgt 10 2.073 ~ 0.028 s/op
  21. StartupBenchmark.spring a1_10 avgt 10 2.729 ~ 0.061 s/op
  22. StartupBenchmark.spring a1_100 avgt 10 2.750 ~ 0.029 s/op
  23. StartupBenchmark.spring a10_50 avgt 10 7.153 ~ 0.075 s/op
  24. StartupBenchmark.spring a10_100 avgt 10 7.152 ~ 0.059 s/op
  25. StartupBenchmark.spring a20_50 avgt 10 11.430 ~ 0.105 s/op
  26. StartupBenchmark.spring a20_100 avgt 10 11.497 ~ 0.162 s/op
  27. ....
  28. So this is the average **startup time** of an app affected by aspects applying to the beans involved. Where numbers are
  29. referenced the first is the number of aspects/pointcuts and the second is the number of beans. The 'a' indicates an
  30. annotation based pointcut vs a non-annotation based pointcut ('v'). Notice things are much worse for annotation based
  31. pointcuts. At 20 pointcuts and 50 beans the app is 9 seconds slower to startup.
  32. In AspectJ 1.8.12 and 1.9.0.RC1 some work has been done here. The key change is to recognize that the use of annotations
  33. with runtime retention is much more likely than annotations with class level retention. Retrieving annotations with
  34. class retention is costly because we must open the bytes for the class file and dig around in there (vs runtime
  35. retention which are immediately accessible by reflection on the types). In 1.8.11 the actual type of the annotation
  36. involved in the matching is ignored and the code will fetch *all* the annotations on the type/method/field being matched
  37. against. So even if the match is looking for a runtime retention annotation, we were doing the costly thing of fetching
  38. any class retention annotations. In 1.8.12/1.9.0.RC1 we take the type of the match annotation into account - allowing us
  39. to skip opening the classfiles in many cases. There is also some deeper work on activating caches that were not
  40. previously being used correctly but the primary change is factoring in the annotation type.
  41. What difference does that make? AspectJ 1.8.12:
  42. [source, text]
  43. ....
  44. Benchmark (scale) Mode Cnt Score Error Units
  45. StartupBenchmark.ltw N/A avgt 10 2.620 ~ 0.130 s/op
  46. StartupBenchmark.ltw_100 N/A avgt 10 2.567 ~ 0.038 s/op
  47. StartupBenchmark.spring v0_10 avgt 10 2.044 ~ 0.027 s/op
  48. StartupBenchmark.spring v1_10 avgt 10 2.195 ~ 0.026 s/op
  49. StartupBenchmark.spring v1_100 avgt 10 2.237 ~ 0.039 s/op
  50. StartupBenchmark.spring v10_50 avgt 10 2.774 ~ 0.038 s/op
  51. StartupBenchmark.spring v20_50 avgt 10 3.488 ~ 0.116 s/op
  52. StartupBenchmark.spring v20_100 avgt 10 3.642 ~ 0.080 s/op
  53. StartupBenchmark.spring a0_10 avgt 10 2.067 ~ 0.034 s/op
  54. StartupBenchmark.spring a1_10 avgt 10 2.159 ~ 0.030 s/op
  55. StartupBenchmark.spring a1_100 avgt 10 2.207 ~ 0.020 s/op
  56. StartupBenchmark.spring a10_50 avgt 10 2.471 ~ 0.031 s/op
  57. StartupBenchmark.spring a10_100 avgt 10 2.517 ~ 0.045 s/op
  58. StartupBenchmark.spring a20_50 avgt 10 2.842 ~ 0.049 s/op
  59. StartupBenchmark.spring a20_100 avgt 10 2.916 ~ 0.145 s/op
  60. ....
  61. Look at the a20_100 case - instead of impacting start time by 9 seconds, it impacts it by 1 second.