Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Speed up getBean() for singletons with complex dependencies? #409
I ran this on my stand alone test code and saw a pretty healthy jump in performance. This is definitely a big improvement - about 25-30x, which agrees with the numbers you saw.
I've also tried the updates DI/1 file out in a full blown "pathological" application that had problems around getBean() and there is a performance boost there too. Not quite as large since DI/1 is only a part of the larger app, but it seems to have sped things up overall by about 30% overall in that app.
I suspect others will experience some performance gain form these changes as well, though it will probably be far less dramatic than my somewhat extreme edge case.
I plan to do a lot of work in the app today with getBean() and removing the pathological nature of the code so I'll report back if I find any other negative side effects of this change. I looked at the code you changed though and it looks pretty safe.