-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assisted Inject uses child injector to bind args #435
Comments
From limpbizkit on October 08, 2009 21:30:37 Yipes! Which lock? |
From guilleguti84 on October 27, 2009 08:25:49 I want to bump this, doing Assisted Injection in a multithreaded application makes Regards, Guillermo Attachment: gist |
From [email protected] on October 27, 2009 08:40:52 Lock contention is not the only problem with use of a child injector for assisted |
From guilleguti84 on October 27, 2009 09:40:26 A quick update. We had a bottleneck in an Assisted Inject, and we were able to remove By changing that the time inside the Inject was so small that the lock was almost |
From sberlin on October 27, 2009 10:10:28 the reason for using a parent/child injector is mainly to provide AOP, right? would |
From crazyboblee on October 27, 2009 10:23:44 The correct solution here is to fix createChildInjector() to not lock. It's locking so as to |
From sberlin on October 27, 2009 10:30:21 when issue 342 is fixed (disable JIT bindings), child injectors whose parent injector |
From sberlin on March 11, 2010 09:32:42 A lot of the performance penalties are coming from creating a new child injector each |
From sberlin on March 20, 2010 12:55:05 Attached is a pretty quick & dirty TestCase for to illustrate the perf differences I'll play around with some perf tools to see just where the problems are (it isn't Attachment: gist |
From sberlin on March 20, 2010 13:54:33 Using toConstructor does help things a lot, but it's still significantly slower. old style assisted inject: ~800ms So it shaved off ~4s in 100k runs, which is pretty significant, but is still ~10s (Yes, using pure time values is relative on all machines, but these values are all Attached is the proof-of-concept patch I did in FactoryProvider2 to make it use |
From dhanji on March 20, 2010 15:23:45 Very Cool! Btw a few comments, from my experience microbenching: - were these just single runs or did you average them over several? IME, they seem to vary a lot
|
From sberlin on March 20, 2010 15:53:11 I didn't average the runs, but I did do it several times and eyeballed the runs to be Changing the warmup to be 100k runs and repeating both warmup & test 10 times for |
From sberlin on March 20, 2010 18:39:49 Some stats on profiling with YourKit tracing (w/ the toConstructor patch, since 1k runs w/ a FactoryProvider2's factory.create, with profiling enabled takes ~4s. That's the path of the worst offenders, mostly everything over ~100ms, traced down There's nothing clearly heinous about it except for the fact that creating a child |
From sberlin on March 21, 2010 08:40:50 Since profiling didn't reveal any obvious places to optimize (just the entire flow of old style assisted inject: ~800ms Clearly a big win as far as performance goes. Can anyone think of any reason why the Patch to apply optimization to FactoryProvider2 is attached. |
From sberlin on March 21, 2010 17:37:30 I should note, the optimization patch in comment #14 also fixed the the lock I was also mistaken about requireExplicitBindings fixing the lock contention -- the |
From sberlin on March 24, 2010 20:44:53 committed r1147 (includes tests) which should fix this problem for 99.9% of i think this can pave the way for: |
From sberlin on March 27, 2010 13:38:30 fixed in r1147 . Status: Fixed |
From dhanji on October 09, 2009 00:07:04
This causes MASSIVE lock contention if used inside a running app. Which is Bad(TM)
Original issue: http://code.google.com/p/google-guice/issues/detail?id=435
The text was updated successfully, but these errors were encountered: