QPIDJMS-417 Reduce GC pressure while using BytesMessage#22
QPIDJMS-417 Reduce GC pressure while using BytesMessage#22franz1981 wants to merge 1 commit intoapache:mainfrom
Conversation
Using directly ByteBuf-based streams allows to avoid unnecessary creations of intermediate instances to operate on the underline ByteBuf content
|
@gemmellr @tabish121 I'm not very proud to have exposed directly the ByteBuf streams, but I have tried to use the right type on the facade and it makes the code really unreadable (and confuse the mocking framework too!!) :( |
|
Can you elaborate on the benefits you measured here? I'd like to understand the extent to consider against the downside of exposing dep impl types throughout the code base. The existing bits worked the way it did at least a small part because BytesMessage specified thats where it gets its behaviours from. Are we sure ByteBuf streams behave the same? |
Fair enough 👍 I will come up with a test to measure the reduction of GC (with 100 bytes message)
Looking at the tests on Netty (where I have put recently a PR re some of these classes) it seems the case, but it is not part of Java util classes so they could be wrong on it. Do we have some tests to verify the impact on the client of it? |
Using directly ByteBuf-based streams allows to avoid
unnecessary creations of intermediate instances to
operate on the underline ByteBuf content