[MAGNOLIA-5654] Upgrade or replace mycila-guice Created: 31/Jan/14  Updated: 02/Mar/22  Resolved: 02/Mar/22

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Tobias Mattsson Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: ioc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MAGNOLIA-5654.patch    
Issue Links:
relation
is related to MAGNOLIA-5153 The support for @PostConstruct (JSR25... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

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.

[1] https://code.google.com/p/mycila/issues/detail?id=47


Generated at Mon Feb 12 04:07:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.