-
Notifications
You must be signed in to change notification settings - Fork 341
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
perf: use a sync pool for machine constructor #625
Conversation
Nice. What was used for benchmarking? Added one comment for feedback above. |
I ran the gno code like this, in the benchmark.
And for the profiling, i used.
|
@jaekwon, do you think @peter7891's answer is satisfactory? Can we merge his work? Should we add any comments or issues for future improvements, or include unit tests? |
The only thing i could possibly see adding a test for is to make sure the values from a fetched object are zero-ed. |
2a10d16
to
d9890f7
Compare
d9890f7
to
9d1e538
Compare
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.
LGTM
This PR uses a
sync.Pool
in theMachine
constructor.This improves the following
issue with benchmarks from master.
Benchmarks on this branch.
CPU bench
Memory profile
As we can see, we no longer have the
Machine
constructor in the top 10 of either.And we can see that the memory consumption went from 28666.37kB to 15054.80kB.