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
Reuse the same allocator as used by the ByteBuf
that is used during…
#10226
Conversation
/cc @fabienrenaud |
db13040
to
dde1499
Compare
… multipart decoding Motivation: We should not use Unpooled to allocate buffers if possible to ensure we can make use of pooling etc. Modifications: - Only allocate a buffer if really needed - Use the ByteBufAllocator of the offered ByteBuf - Ensure we not use buffer.copy() but explicitly allocate a buffer and then copy into it to not hit the limit of maxCapacity() Result: Improve allocations
dde1499
to
278b781
Compare
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.
Except that I personally prefer the ternary operator (expression style) instead of if/else with multiple assignments, LGTM.
@slandelle addressed.... PTAL again |
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.
LGTM
#10226) Motivation: We should not use Unpooled to allocate buffers if possible to ensure we can make use of pooling etc. Modifications: - Only allocate a buffer if really needed - Use the ByteBufAllocator of the offered ByteBuf - Ensure we not use buffer.copy() but explicitly allocate a buffer and then copy into it to not hit the limit of maxCapacity() Result: Improve allocations
* '4.1' of github.com:netty/netty: (24 commits) Rename testmethods to make these more clear (netty#10231) Specify algorithm for key pair in self signed certificate to generate EC or RSA based certificate. (netty#10223) Reuse the same allocator as used by the `ByteBuf` that is used during… (netty#10226) Remove some debugging cruft (netty#10229) Fix memory leak in HttpPostMultipartRequestDecoder (netty#10227) Don't log with warn level in the DnsNameResolver in most cases (netty#10225) Detect CNAME loops in the CNAME cache while trying to resolve (netty#10221) Update to latest Conscrypt release and add workarounds for bugs (netty#10211) HttpPostRequestDecoder: retain instead of copy when first buf is last (netty#10209) Move up the size check in AbstractDiskHttpData.setContent. (netty#10222) Dns resolver: honor resolv.conf timeout, rotate and attempts options (netty#10207) Add check for DefaultFileRegion to calculate size of msg in AbstractTrafficShapingHandler (netty#10215) Remove unused import in JsonObjectDecoder.java (netty#10213) Fix a potential fd leak in AbstractDiskHttpData.delete (netty#10212) Update testsuite / pom.xml to be able to build with Java15 (netty#10210) Add fastpath implementation for Unpooled.copiedBuffer(CharSequence, Charset) when UTF-8 or US-ASCII is used (netty#10206) Add epoll aarch64 maven config and Dockerfile (netty#9804) HTTP2: Guard against multiple ctx.close(...) calls with the same ChannelPromise (netty#10201) [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release netty-4.1.49.Final ...
netty#10226) Motivation: We should not use Unpooled to allocate buffers if possible to ensure we can make use of pooling etc. Modifications: - Only allocate a buffer if really needed - Use the ByteBufAllocator of the offered ByteBuf - Ensure we not use buffer.copy() but explicitly allocate a buffer and then copy into it to not hit the limit of maxCapacity() Result: Improve allocations
… multipart decoding
Motivation:
We should not use Unpooled to allocate buffers if possible to ensure we can make use of pooling etc.
Modifications:
Result:
Improve allocations