GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Specialize Adaptive's allocator Recycler based on magazine's owner by franz1981 · Pull Request #14421 · netty/netty Conversation
|
|
@normanmaurer this is on top of #14414 just to ease reviewing it The actual changes are the ones at 2baa8c208a291723ae6fe186cbe4b924518c2acb And are not definitive enough because of #14414 (comment) TLDR we have a potentially megamorphic call on the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@normanmaurer @chrisvest I've gotten rid of the megamorphic call mentioned at #14421 (comment) by adding 2c3b15c50daed0f4b6a93a34568e2e9f6c304520 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I tried running benchmarks with this, but I'm not seeing much improvement. I used 10 forks in these runs: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Are u using an apple processor? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As expected by my own comment at
running the which means that despite the jmh executor should be an event loop, the magazine used is NOT event loop local. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
And it seems @chrisvest that you need to set and the actual behaviour reflect how good this optimization is As you can see the number of atomic ops are much reduced and numbers have changed accordly This PR without Now, adding the proper configuration i.e. This PR: Before this PR: There's some improvement (as expected) - but I still see too many |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As per
I was wrong: it seems that we have 2 compareAndSet (which are too much IMO) - one for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should we merge #14414 first and just rebase this one as a "follow up" ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
sure things, I would wait @chrisvest feedbacks after adding that option I suggested; x86 is not the only arch we would like to make happy I think 🤔 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes. I reran the benchmark with the option, and see some improvements as well: We need to look into why the JMH executor setting isn't having the effect we expect. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That's what I originally suggested. No harm in iterating on things over multiple PRs as long as they individually don't break things. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please do @chrisvest |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
dbc9e75 to
b711ad0
Compare
b711ad0 to
3e45566
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@franz1981 feel free to pull in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Motivation: EventLoop local magazines are treated the same as shared ones Modifications: Use existing Recycler(s) on un-shared magazines to save expensive atomic operations while reusing adaptive buffers Result: Further improve netty#14279 for the common path i.e. event loops
3e45566 to
35b1980
Compare
| buf = new AdaptiveByteBuf(handle); | ||
| } | ||
| } | ||
| buf.resetRefCnt(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I guess its not a big deal but we could just not do this when we allocate a new buffer...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
most times we end-up reusing some (hopefully) - but I'm ok to move it in the right branch too, LMK
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Anyway is not using a volatile operation, but a lazySet AFAIK, which is way cheaper
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…etty#14421) Motivation: EventLoop local magazines are treated the same as shared ones Modifications: Use existing Recycler(s) on un-shared magazines to save expensive atomic operations while reusing adaptive buffers Result: Further improve netty#14279 for the common path i.e. event loops
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.