Skip to content
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

Merged
merged 5 commits into from Feb 21, 2024

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Feb 21, 2024

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.

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.
@gregw gregw requested review from sbordet and lorban and removed request for sbordet February 21, 2024 08:02
@gregw gregw requested a review from lorban February 21, 2024 09:22
@gregw
Copy link
Contributor Author

gregw commented Feb 21, 2024

@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.

@lorban
Copy link
Contributor

lorban commented Feb 21, 2024

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 main method?

lorban
lorban previously approved these changes Feb 21, 2024
@lorban
Copy link
Contributor

lorban commented Feb 21, 2024

@gregw
Copy link
Contributor Author

gregw commented Feb 21, 2024

@lorban what was the "hiccup" in the middle of that perf run?
Does it always do that?

@gregw
Copy link
Contributor Author

gregw commented Feb 21, 2024

@sbordet thoughts?

@lorban
Copy link
Contributor

lorban commented Feb 21, 2024

@gregw that hiccup is caused by async-profiler; disabling it makes the hiccup go away, and yes: it always dips around the 60th second.

@gregw gregw requested review from sbordet and lorban February 21, 2024 16:52
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>
@gregw gregw merged commit 750584b into jetty-12.0.x Feb 21, 2024
8 checks passed
@gregw gregw deleted the experiment/jetty-12.0.x/ArrayByteBufferPool branch February 21, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants