-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Mark Paluch opened SPR-17558 and commented
CharSequenceEncoder uses CharBuffer.wrap and charset.encode to encode String data to its binary representation. There can be two optimizations made here:
CharSequenceEncoderuses typically UTF-8 encoding and Java's UTF-8 encoder requires significant computing time. It would make sense to detect this case and whether netty is on the class path to use netty's optimized UTF-8 encoding viaByteBufUtil.writeUtf8(…)- Encoding creates a new unpooled
ByteBufferwhen callingCharset.encode. Netty'sByteBufUtil.encodeString()can encode aStringto a pooled buffer that reduces GC pressure.
See also attached profiling snapshot.
Attachments:
- LettucetestApplication-2018-12-03-RenderStringToBytesCharsetEncoder.snapshot.zip (2.40 MB)
- Write as String.png (431.36 kB)
Referenced from: commits 5a8b8b1, 6361b0c, a00be62, 4955d08
0 votes, 5 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement