Project

General

Profile

Actions

Bug #2692

closed

Cache Spring IoC name resolution to make Rudder faster

Added by Nicolas CHARLES over 12 years ago. Updated over 12 years ago.

Status:
Released
Priority:
1 (highest)
Category:
Architecture - Code maintenance
Target version:
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

Also available in: Atom PDF