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
ARTEMIS-1573 Improve UTF translation allowing zero copy #1753
Conversation
Please do not merge yet: I've already run the CI and compatibility tests (kudos to @clebertsuconic work on it!), but I will need to provide some results on it 👍 |
@@ -34,7 +35,7 @@ | |||
|
|||
private static final boolean isTrace = ActiveMQUtilLogger.LOGGER.isTraceEnabled(); | |||
|
|||
private static final ThreadLocal<SoftReference<StringUtilBuffer>> currenBuffer = new ThreadLocal<>(); | |||
private static final FastThreadLocal<SoftReference<StringUtilBuffer>> currentBuffer = new FastThreadLocal<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only benefits if all threads are FastThreadLocalThread's. Do we re-use Netty's thread pools? I thought we had our own....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelandrepearce Good catch! I will change it in no time, thanks!
e6bfe51
to
1954146
Compare
@clebertsuconic @michaelandrepearce
|
@franz1981 LGTM. The only comment i would have, is it worth adding the code to handle the offheap now also, just while its fresh in your mind, and then it be more complete feature. And if you disagree then thats also fine, id be still happy for this to merge. |
Agree :) I've avoided to implement them (for the |
The UTF translations has been improved by: - zero copy on array based buffers - zero copy UTF length calculation - faster array access using Netty PlatformDependent.get|putByte - improved perf tests UTF8Test
I've changed the last few bits and these are some results:
|
1954146
to
dc44b69
Compare
@franz1981 looks good, ill look to merge this afternoon, just to confirm no more bits right? |
The UTF translations has been improved by: