[ https://issues.apache.org/jira/browse/PROTON-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16571843#comment-16571843 ]
ASF GitHub Bot commented on PROTON-1911: ---------------------------------------- GitHub user ctron opened a pull request: https://github.com/apache/qpid-proton-j/pull/14 PROTON-1911: Improve performance of EncoderImpl#writeRaw(String) This change uses a small thread local buffer to gather data locally before sending it in bigger chunks to the buffer. This keeps the memory consumption low and doesn't put more stress on the garbage collector. But improves the performance of the method by factor 4. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ctron/qpid-proton-j feture/fix_string_perf_1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/qpid-proton-j/pull/14.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14 ---- commit bdb202b4acc447ed5385d9712e6ba949cc84e34c Author: Jens Reimann <jreimann@...> Date: 2018-08-07T15:29:02Z PROTON-1911: Improve performance of EncoderImpl#writeRaw(String) This change uses a small thread local buffer to gather data locally before sending it in bigger chunks to the buffer. This keeps the memory consumption low and doesn't put more stress on the garbage collector. But improves the performance of the method by factor 4. ---- > Performance issue in EncoderImpl#writeRaw(String) > ------------------------------------------------- > > Key: PROTON-1911 > URL: https://issues.apache.org/jira/browse/PROTON-1911 > Project: Qpid Proton > Issue Type: Improvement > Components: proton-j > Affects Versions: proton-j-0.22.0, proton-j-0.28.0 > Reporter: Jens Reimann > Priority: Major > Labels: pull-request-available > Attachments: qpid_encode_1.png, qpid_encode_2.png, qpid_encode_3.png, > qpid_encode_4.png > > > While digging into performance issues in the Eclipse Hono project I noticed a > high consumption of CPU time when encoding AMQP messages using proton-j. > I made a small reproducer and threw the same profiler at it, here are the > results: > As you can see in the attach screenshot (the first is the initial run with > the current code) most of the time is consumed in > EncoderImpl#writeRaw(String). This due to the fact that is call "put" for > every byte it want to encode. > The following screenshots are from a patched version which uses a small > thread local buffer to locally encode the raw data and then flush it to the > buffer in bigger chunks. > Screenshot 3 and 4 show the improve performance, but also show that the > memory consumption stays low. > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org