-
Improvement
-
Resolution: Obsolete
-
Neutral
-
None
-
None
We're using mycila-guice 2.10.ga which suffers from bad performance. This was reported in MAGNOLIA-5153 where we made the feature optional and disabled by default. I opened a ticket with mycila [1] and provided that a patch that made it into 2.15.ga. This version is not available on maven central unfortunately.
Another option would be to replace mycila and implement support for @PostConstruct ourselves. Attached is a patch with exactly this.
The patch contains a main method in NewInstanceTest that tests the performance improvement. It should not be merged into the product.
Printout with Mycila Guice 2.10.ga:
To create 1000000 instances of a class with a @PostConstruct method
Time without Mycila: 204 ms 0 invocations
Time with Mycila: 4253 ms 1000000 invocations
Time with Patch: 187 ms 1000000 invocations
To create 1000000 instances of a class without @PostConstruct method
Time without Mycila: 174 ms 0 invocations
Time with Mycila: 3921 ms 0 invocations
Time with Patch: 174 ms 0 invocations
Mycila 2.15.ga is considerably faster almost matching the patch.
- is related to
-
MAGNOLIA-5153 The support for @PostConstruct (JSR250) by using mycila-guice is not performant
- Closed