-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ArrayRetainableByteBufferPool
inefficiently calculates bucket indices
#8810
Comments
ArrayRetainableByteBufferPool.bucketFor()
inefficiently calculates bucket indicesArrayRetainableByteBufferPool.bucketFor()
inefficiently calculates bucket indices
ArrayRetainableByteBufferPool.bucketFor()
inefficiently calculates bucket indicesArrayRetainableByteBufferPool
inefficiently calculates bucket indices
Here's an async profiler flame graph that shows |
@lorban do you want to do this for the upcoming Jetty 10 / Jetty 11 releases? |
@joakime It's not going to have much impact, no in terms of reliability (we're just replacing But we did agree that it is too late for #8762 to be included in the upcoming release. |
@lorban in that case, I've moved this from 10.0.13 to 10.0.14 |
…bucket indices Added constructor that uses IntUnaryOperator to avoid boxing. Deprecated constructor that uses Function<Integer, Integer>. Signed-off-by: Simone Bordet <[email protected]>
…bucket indices (#8882) Added constructor that uses IntUnaryOperator to avoid boxing. Deprecated constructor that uses Function<Integer, Integer>. Signed-off-by: Simone Bordet <[email protected]>
Jetty version(s)
10, 11, 12
Enhancement Description
The
ArrayRetainableByteBufferPool.bucketFor()
method is on the fast path of every served request, and it delegates its index calculation to aFunction<Integer, Integer>
lambda. This implies boxing and unboxing are happening each time a bucket must be chosen, and this inefficiency started appearing in profiling reports.This code should be modified so that no boxing/unboxing is done anymore. A simple way would be to replace the
Function<Integer, Integer>
lambda with a customIntIntFunction
one for instance.The text was updated successfully, but these errors were encountered: