-
Notifications
You must be signed in to change notification settings - Fork 712
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
optimisation: allocate less memory in LatestMap merging #2956
Conversation
so they can share code and are easier to run in combination. We take advantage of the code sharing by generalising the report rendering benchmarks to read & merge reports from a dir.
benchmarks, using 10s worth of reports, best results of four runs of
master
branch
So we allocate ~17% less memory during merging. I included the rendering benchmarks because rendering also merges nodes, so I wanted to check that we didn't negatively impact performance. |
Most maps we merge have the same keys, or at least one set of keys is the subset of the other. Therefore, allocate a result slice capable of holding only the max of number keys, rather than the sum.
7134135
to
4162b5d
Compare
Did you run this with memory profiling? That would show how many times the |
Surely the increase in the figure should be 263083-2609989. |
I don't see any allocations in the
Same for To check that I wasn't doing anything wrong in the profiling, I changed the code to allocate So now I mystified why my the benchmark results show an increase in the |
Most maps we merge have the same keys, or at least one set of keys is the subset of the other. Therefore, allocate a result slice capable of holding only the max of number keys, rather than the sum.