You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While tracking down a performance problem (Graylog2/graylog2-server#5669)
I noticed that Jersey was creating thousands of ServiceLocators in our application.
Since we are creating a GuiceBridge for each Locator, a lot of time is spent filling the cache
of the GuiceToHk2JitResolver.
Thanks,
after reading this, I still fail to understand why each Resource needs a separate ServiceLocator.
Even if this is not a bug, the current implementation has a huge performance impact in the use case
I described above.
While tracking down a performance problem (Graylog2/graylog2-server#5669)
I noticed that Jersey was creating thousands of ServiceLocators in our application.
Since we are creating a GuiceBridge for each Locator, a lot of time is spent filling the cache
of the
GuiceToHk2JitResolver
.The root of the problem is that Jersey creates a ServiceLocator for each Resource
in case of a dynamically registered Provider class:
https://github.com/eclipse-ee4j/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java#L229
What's the reason behind this? Why do we need a separate DI context in this case?
I also build a small demo app that exposes the problem:
https://github.com/mpfz0r/jersey-di-issue
The text was updated successfully, but these errors were encountered: