-
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
Experiment with ArrayByteBufferPool performance #11426
Experiment with ArrayByteBufferPool performance #11426
Conversation
No overall size accounting reserved buffer release always checks max memory released buffers check max memory 1% of the time. only a single thread can check memory at once. single pass through buckets so no looping forever.
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java
Show resolved
Hide resolved
jetty-core/jetty-io/src/test/java/org/eclipse/jetty/io/ArrayByteBufferPoolTest.java
Show resolved
Hide resolved
updates from review
@lorban can you perf test this both in JMH and overall so we can see if this makes a difference, or do we need to look for a better approach. |
I think this is the best we can do, given what we expect from ABBP. Could you please just add the following test to the benchmark: @Benchmark
@BenchmarkMode({Mode.Throughput})
public void fastPathAcquireRelease()
{
RetainableByteBuffer buffer = pool.acquire(65535, true);
buffer.release();
} and modify the threads count to 32 in the |
FYI here's a perf run of this branch: Perf of the fast path is on par with 12.0.6. |
@lorban what was the "hiccup" in the middle of that perf run? |
@sbordet thoughts? |
@gregw that hiccup is caused by async-profiler; disabling it makes the hiccup go away, and yes: it always dips around the 60th second. |
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java
Outdated
Show resolved
Hide resolved
Fixed call to recordEvict(). Removed unused methods. Method getAvailable*Memory() no longer JMX-enabled, as they are the same as get*Memory(). Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
No overall size accounting
reserved buffer release always checks max memory
released buffers check max memory 1% of the time.
only a single thread can check memory at once.
single pass through buckets so no looping forever.