Actions
Bug #2692
closedCache Spring IoC name resolution to make Rudder faster
Status:
Released
Priority:
1 (highest)
Assignee:
Category:
Architecture - Code maintenance
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
As the coed base of Rudder is growing (exponentially ?), the code get slower and slower
After some tinkering and looking at the plumbing, it appears that the dependency injection is the culprit (at least on my system).I did some benchmark :
- creating the form for searching nodes take, without JRebel activated, takes 800 ms (rendering is longer due to other issues still non searched for)
- by simply naming all the bean used with injection, the forms takes 160 ms to be created
In a nutshell, changing from
private[this] lazy val nodeGroupRepository = inject[NodeGroupRepository]
to
private[this] lazy val nodeGroupRepository = inject[NodeGroupRepository]("ldapNodeGroupRepository")
for each inject dramatically fastens the code.
Alas, naming object with String is very fragile and error prone (no check at compile time, difficult refactoring, and no detection before it breaks, in production when we get unlucky)
I'm still investigating on the subject
Actions