Project

General

Profile

Actions

Bug #2692

closed

Cache Spring IoC name resolution to make Rudder faster

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

Status:
Released
Priority:
1
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 #2

Updated by Nicolas CHARLES over 11 years ago

  • Status changed from New to Pending technical review
  • % Done changed from 0 to 100
Actions #3

Updated by Nicolas CHARLES over 11 years ago

With this commit, the form creating time is only 8 ms, and the full display is 75 ms

Actions #4

Updated by François ARMAND over 11 years ago

  • Subject changed from Rudder is getting slower and slower to Cache Spring IoC name resolution to make Rudder faster

That seems cool !
Thank you really much Nico for that one. That make me really want to throws Spring, more than the fact that it's a huge bloaty monster.

Actions #5

Updated by François ARMAND over 11 years ago

  • Status changed from Pending technical review to Released
Actions

Also available in: Atom PDF