BewareMyPower commented on code in PR #24766: URL: https://github.com/apache/pulsar/pull/24766#discussion_r2363294314
########## pip/pip-443.md: ########## @@ -0,0 +1,233 @@ +# PIP-443: Stop using Netty Recycler in new code + +# Background knowledge + +Netty [`Recycler`](https://github.com/netty/netty/blob/netty-4.1.127.Final/common/src/main/java/io/netty/util/Recycler.java) is widely used in many places to reduce GC pressure by reusing objects. From the outputs of the following command: + +```bash +find . -name "*.java" | grep src/main | xargs grep -n "new .*Recycler" +``` + +You can find: +- 5 usages in `pulsar-common` +- 10 usages in `pulsar-broker` +- 10 usages in `pulsar-client` + +However, it's a pre-mature optimization without any real world evidence. Many of them are only the result of cargo cult programming. Hence, we should understand how it works first. Review Comment: I mentioned the GC evolution a bit in `Issue 3` section. I can add this info to that section as well -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
