Skip to content
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

Split defer cost out of BenchmarkSuccess #14

Merged
merged 1 commit into from
May 6, 2022
Merged

Split defer cost out of BenchmarkSuccess #14

merged 1 commit into from
May 6, 2022

Conversation

dsnet
Copy link
Owner

@dsnet dsnet commented May 6, 2022

This allows us to measure the cost of E and Handle seperately.

This allows us to measure the cost of E and Handle seperately.
@dsnet dsnet requested a review from josharian May 6, 2022 19:21
@dsnet
Copy link
Owner Author

dsnet commented May 6, 2022

For the record, this prints:

BenchmarkDefer-24       100000000           10.66 ns/op        0 B/op          0 allocs/op
BenchmarkSuccess-24     1000000000           0.5143 ns/op          0 B/op          0 allocs/op
BenchmarkFailure-24      2998248           399.1 ns/op        24 B/op          1 allocs/op

That's good news since it means that the E functions are really cheap.

Defers are pretty expensive, and most of the cost seems to be in the defer implementation itself. I didn't look too much into it.

@dsnet dsnet merged commit 8450eb7 into master May 6, 2022
@dsnet dsnet deleted the benchmark branch May 6, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants