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 — allow LocalChannel queue to be overridden by descendants and use a default Queue that allocates less by JerryShea · Pull Request #15993 · netty/netty Conversation
|
| return state == State.CONNECTED; | ||
| } | ||
|
|
||
| protected Queue<Object> newQueue() { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@JerryShea what kind of implementation you look to use here ? I wonder if we can't just use something better by default ?
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.
Hi @normanmaurer - we are currently trying out a few different implementations, including MpscChunkedArrayQueue (which allocates a lot less, and is already used by Recycler). My thinking was to make LocalChannel behave similarly to DefaultEventLoop#newTaskQueue - IMO it would be ideal if we could make it pluggable to allow maximal flexibility.
Our testing is ongoing (with a few different Queue impls), so I can't yet confirm if MpscChunkedArrayQueue is definitely a better solution but I'll certainly keep you posted.
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.
JCTools also has SPSC versions of the chunked array queue. We could add a PlatformDependent.newFixedSpscQueue(int) method for that purpose.
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.
Thanks @chrisvest - I agree that SpscChunkedArrayQueue would make a very sensible default.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JerryShea seems like your change introduced test-failures... PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Woops, let me look into - thanks @normanmaurer |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JerryShea let me know once I should review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * Create a new {@link Queue} which is safe to use for single producer (one thread!) and a single | ||
| * consumer (one thread!). | ||
| */ | ||
| public static <T> Queue<T> newChunkedSpscQueue(final int chunkSize, final int capacity) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@chrisvest I called it "...Chunked..." in the end to make consistent with newChunkedMpscQueue
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4d4b2fb to
68a9b27
Compare
| } | ||
|
|
||
| protected <T> Queue<T> newQueue() { | ||
| return PlatformDependent.newChunkedSpscQueue(1024, 4 << 20); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
seeking the advice of netty maintainers here regarding how best to configure this
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.
I've used system properties like the Recycle. @chrisvest @normanmaurer hope this all looks OK now - I think it is ready for review again
Sorry, something went wrong.
There was an error while loading. Please reload this page.
All the tests now pass. Please re-review @normanmaurer It is by no means finished but seems to work well. It imrpoves garbage and performance for our workload. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JerryShea I think this is a better fix for the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
oh that is much nicer. I will remove those changes from my branch and rebase mine on yours (or cherry-pick) and test locally |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I see your PR is against 4.2. Would you prefer we make these changes against 4.2 in the first instance and then backport to 4.1? We are still running 4.1 still... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JerryShea usually we do 4.2 first and then back port |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
24c8ec7 to
ab8c37f
Compare
OK, tomorrow I will re-apply to 4.2, which means I can then cherry pick your commit instead of manually copying |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a265a76 to
9a6c14f
Compare
5010c40 to
42001ec
Compare
@normanmaurer I believe this is ready for the next review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the tick @normanmaurer - please see also #16035 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
42001ec to
c6b9123
Compare
3a05430 to
3e5f138
Compare
3e5f138 to
3b0959f
Compare
|
I've rebased and pushed. This PR contains the same changes as the 4.1 PR. Sorry I should have just created one PR! I can delete one if the maintainers prefer. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3b0959f to
6a98de4
Compare
…unked*ArrayQueue as the default
6a98de4 to
28cffbc
Compare
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.