-
Notifications
You must be signed in to change notification settings - Fork 17
Add StringReader input benchmark #9
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
Conversation
Updated benchmarks with
Subset run on JDK 11.0.20 for comparison
|
|
|
@schlosna LMK if/when this is ready and I can merge it. |
Hey @cowtowncoder , thanks for the review. I think this benchmark shows StringReader is a solid win over InputStreamReader for smaller I am curious for your thoughts on FasterXML/jackson-core#1081 using StringReader for |
Ahh, just saw that merged, let me fix this benchmark up shortly. |
@schlosna Yeah -- I was thinking of asking whether threshold:
so it'd be interesting to know (2). But then again it's not the a huge concern; just LMK if you have ideas of even better tuning. |
I'll run the My sense is that the results will depend heavily on CPU cache size. Not directly applicable to this case, but OpenJDK 21 is bumping up the internal |
@schlosna Sounds good: your help is much appreciated! |
I ran a slightly modified version schlosna@ce7fcec to explicitly test different size inputs and ran locally on a MacBook Pro. For the
For the mode where field name canonicalization feature is disabled:
The configuration @carterkozak and I have been investigating is with both interning and field name canonicalization disabled, and Based on this, I'm inclined to leave the current threshold at 8KiB for now unless other folks have objections.
|
Quick subset of benchmarks on
|
Thank you @schlosna for verifying that 8kB limit seems sensible. |
Optimize to avoid allocation of heap ByteBuffer via InputStreamReader. Remove after upgrade to Jackson 2.16. see: FasterXML/jackson-core#1081 and FasterXML/jackson-benchmarks#9
Optimize to avoid allocation of heap ByteBuffer via InputStreamReader. Remove after upgrade to Jackson 2.16. see: FasterXML/jackson-core#1081 and FasterXML/jackson-benchmarks#9
Builds on #6 to benchmark a
CharBufferReader
for FasterXML/jackson-core#1079 andStringReader
for FasterXML/jackson-core#1081@carterkozak curious for your thoughts on this. We may want to benchmark some larger inputs as well.
Initial benchmarks show
StringReader
andCharBufferReader
providing performance equivalent toByteArrayInputStream
source in worst case, and anywhere from ~2x to ~10x speedup in best case.Subset run on JDK 11.0.20 for comparison