Skip to content
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

PROTON-2287 Improve Symbol decoding cache #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

franz1981
Copy link
Contributor

@franz1981
Copy link
Contributor Author

franz1981 commented Nov 5, 2020

This is the improvement related:

master

Benchmark                                             Mode  Cnt    Score     Error   Units
SymbolsBenchmark.decode                               avgt    5  283.784 ±   4.618   ns/op
Benchmark                                                                Mode  Cnt    Score   Error  Units
CompositeReadableBufferBenchmark.hashCodeMultipleArrayFullSpan           avgt   10  770.841 ± 6.285  ns/op
CompositeReadableBufferBenchmark.hashCodeMultipleArraySpanInSingleArray  avgt   10  113.202 ± 0.330  ns/op
CompositeReadableBufferBenchmark.hashCodeSingArraySpanInSingleArray      avgt   10  114.003 ± 1.756  ns/op
CompositeReadableBufferBenchmark.hashCodeSingleArrayFullSpan             avgt   10  581.803 ± 2.284  ns/op
Benchmark                                                                     (chunks)  (direct)  (size)  Mode  Cnt    Score   Error  Units
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                      1     false       8  avgt   10   25.528 ± 0.038  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                      1     false      16  avgt   10   33.414 ± 0.117  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                      1     false      64  avgt   10   61.316 ± 2.427  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                      1      true       8  avgt   10   26.567 ± 1.156  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                      1      true      16  avgt   10   40.832 ± 0.672  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                      1      true      64  avgt   10  125.804 ± 0.590  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer         1     false       8  avgt   10   27.091 ± 0.156  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer         1     false      16  avgt   10   29.060 ± 0.032  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer         1     false      64  avgt   10   60.711 ± 3.901  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer         1      true       8  avgt   10   29.594 ± 0.262  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer         1      true      16  avgt   10   45.407 ± 1.230  ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer         1      true      64  avgt   10  149.863 ± 0.794  ns/op

on this pr:

Benchmark                       Mode  Cnt    Score   Error  Units
SymbolsBenchmark.decode         avgt   20  197.239 ± 2.010  ns/op
Benchmark                                                                Mode  Cnt    Score   Error  Units
CompositeReadableBufferBenchmark.hashCodeMultipleArrayFullSpan           avgt   10  768.331 ± 2.098  ns/op
CompositeReadableBufferBenchmark.hashCodeMultipleArraySpanInSingleArray  avgt   10   59.398 ± 0.385  ns/op
CompositeReadableBufferBenchmark.hashCodeSingArraySpanInSingleArray      avgt   10   61.704 ± 4.174  ns/op
CompositeReadableBufferBenchmark.hashCodeSingleArrayFullSpan             avgt   10  279.393 ± 2.857  ns/op
Benchmark                                                                                         (chunks)  (direct)  (size)  Mode  Cnt    Score    Error   Units
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                                          1     false       8  avgt   10   19.090 ±  0.548   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                                          1     false      16  avgt   10   24.537 ±  0.175   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                                          1     false      64  avgt   10   57.523 ±  0.647   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                                          1      true       8  avgt   10   22.165 ±  0.068   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                                          1      true      16  avgt   10   35.275 ±  0.153   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToByteBufferReader                                          1      true      64  avgt   10   82.179 ±  0.196   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer                             1     false       8  avgt   10   22.076 ±  0.080   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer                             1     false      16  avgt   10   26.474 ±  0.194   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer                             1     false      64  avgt   10   59.139 ±  0.410   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer                             1      true       8  avgt   10   25.968 ±  0.120   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer                             1      true      16  avgt   10   35.986 ±  0.130   ns/op
CompositeReadableBufferEqualsBenchmark.equalsToWithSingleArraySubsetOfBuffer                             1      true      64  avgt   10  100.742 ±  0.395   ns/op

@franz1981
Copy link
Contributor Author

The changes on this PR (especially those that save creating a slice while decoding should benefit decoding in general :)
I'm now testing this with and end 2 end test using QPID JMS and Artemis 👍

@franz1981
Copy link
Contributor Author

I've noticed a thing, due to the changes on decoding ie not creating the slice anymore:
I'm getting a huge amount of StringType$1.decode unseen before, see

image

in violet

@franz1981
Copy link
Contributor Author

@gemmellr I've tried an end 2 end test but I'm still struggling to evaluate the perf improvement (that's strange, but not unexpected, according to our chats). I'm investigating what's happening ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant