-
Notifications
You must be signed in to change notification settings - Fork 14
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
Override next() and endOfJson() methods because JIT C2 keeps de-optimizing them #185
Conversation
Note These results are affected by shared workloads on GitHub runners. Use the results only to detect possible regressions, but always rerun on more stable machine before making any conclusions! Benchmark results (pull-request, 5aa6566)
Benchmark results (master, 9f0690f)
|
de958c0
to
5aa6566
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, so after all you went with decoupling them 😀 To me, that now looks much better
@gavlyukovskiy's benchmarks chart shows that streaming mode PR degrades performance of byte array mode by ~30%. Upon further examination, it turned out that JIT C2 de-optimizes
next()
andendOfJson()
methods (the most performance critical methods) because of a newreloadBuffer()
condition. Logically, this condition is never triggered in byte array mode, but apparently the condition invalidates some of JIT assumptions and previous optimizations.This PR decouples buffering logic from MaskingState to keep JIT optimizations for
next()
andendOfJson()
intact for byte array API.The preformance chart: