Improve performance of Unpooled.copiedBuffer from CharSequence and char[]
See original GitHub issueHi, there. As we known ByteBufUtil.wirteUtf8()
is faster than ByteBufUtil.encodeString()
when the charset is UTF-8
.
So, If we add some code in Unpooled.copiedBuffer(CharSequence string, Charset charset)
method to predicate the charset
is UTF-8
or not. If true call ByteBufUtil.writeUtf8
method . This will improve the perf evident
Affected methods:
ByteBuf copiedBuffer(CharSequence string, Charset charset) ByteBuf copiedBuffer(CharSequence string, int offset, int length, Charset charset) ByteBuf copiedBuffer(char[] array, Charset charset) ByteBuf copiedBuffer(char[] array, int offset, int length, Charset charset)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Netty :Unpooled.copiedBuffer sending messages to client in ...
I am writing messages to client by using Unpooled.copiedBuffer(myMsg.getByte() , CharsetUtil_UTF_16) . The problem is for string messages ...
Read more >Uses of Class io.netty.buffer.ByteBuf
static ByteBuf, Unpooled. copiedBuffer(CharSequence string, Charset charset). Creates a new big-endian buffer whose content is the specified string encoded in ...
Read more >Index (Netty/All-in-One 4.1.23.Final API) - javadoc.io
addChar(CharSequence, char) - Method in class io.netty.handler.codec.http2. ... BIG_ENDIAN - Static variable in class io.netty.buffer.Unpooled.
Read more >io.netty.handler.codec.http.HttpContent Java Examples
getBytes(); HttpContent chunk1 = new DefaultHttpContent(Unpooled.copiedBuffer(chunk1Bytes)); HttpContent lastChunk = new DefaultLastHttpContent(Unpooled.
Read more >Diff - e9e4e90..f07b6b8 - chromium/src - Git at Google
-77,6 +77,17 @@ def ParseGnList(gn_string): + # TODO(brettw) bug 573132: This doesn't handle GN escaping properly, so any + # weird characters like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@timandy https://github.com/netty/netty/pull/10206 PTAL