-
Notifications
You must be signed in to change notification settings - Fork 603
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
Make the OuterRun class mutable #2417
Conversation
I like the idea though I think we need to understand performance improvements gained by these optimizations since they add complexity. |
So, for a first approximation, I run some of the benchmarks we have in StreamBenchmark, using the command:
This was run on the Graal Java Virtual Machine, Graal VM 21.1.0.r16 (for Java 16). These are the results that I got comparing the measures
|
Here is a second measure of those benchmarks, using a different Java Virtual Machine. This ones were obtained running with the AdoptOpenJDK Java 16.0.1 virtual machine. Also, since the errors were low, I run them with 4 iterations rather than 8.
In this case, the "optimisation" seems to have no impact for some benchmarks, bur for others it seems to reduce the allocation rate by a 10%. Of course, these may be extreme cases. Is there any other "more realistic" benchmark worth trying out? |
Currently, stream compilation would create one new instance of an
OuterRun
for eachChunk
that is emitted up to the top level, even if we are just folding them or merely ignoring them (draning them). Perhaps a little bit of mutability would help.Not sure if this mutable variable would add much risk, since compilation proceeds in sequence, and separate compilations of a same source string would still use separate
OuterRun
instances.