-
Notifications
You must be signed in to change notification settings - Fork 634
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
modified freelist_hmap/hashmapGetFreePageIDs with better performance #419
Conversation
@@ -434,3 +434,27 @@ func newTestFreelist() *freelist { | |||
|
|||
return newFreelist(freelistType) | |||
} | |||
|
|||
func Test_freelist_hashmapGetFreePageIDs(t *testing.T) { |
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.
Can you please implement a microbenchmark an use benchstat to show performance improvement. Article shows how properly use it.
Sorry for being a stickler, but from my experience it's easy to make mistakes when optimizing and we need to standardize the process for writing performance improvement PRs.
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.
benchmark old ns/op new ns/op delta
Benchmark_freelist_hashmapGetFreePageIDs-12 21804519 181847 -99.17%
benchmark old allocs new allocs delta
Benchmark_freelist_hashmapGetFreePageIDs-12 2 3 +50.00%
benchmark old bytes new bytes delta
Benchmark_freelist_hashmapGetFreePageIDs-12 802886 812828 +1.24%
cce63f8
to
f6ccf09
Compare
Signed-off-by: Cenk Alti <cenkalti@gmail.com>
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
Thank you @cenkalti
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.
99% time reduction for 1 alloc. Nice!
Resurrected #219