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

mvcc: Revisions() method for index to avoid key allocation #8428

Merged
merged 1 commit into from
Aug 21, 2017

Conversation

heyitsanthony
Copy link
Contributor

Save another alloc on the one key path.

master:

$ go test -bench=OneKey -run=OneKey -count=4 
BenchmarkStoreRangeOneKey-8      1000000              1883 ns/op             610 B/op         14 allocs/op
BenchmarkStoreRangeOneKey-8      1000000              1807 ns/op             609 B/op         14 allocs/op
BenchmarkStoreRangeOneKey-8      1000000              1861 ns/op             610 B/op         14 allocs/op
BenchmarkStoreRangeOneKey-8      1000000              1850 ns/op             610 B/op         14 allocs/op

branch:

$ go test -bench=OneKey -run=OneKey -count=4
BenchmarkStoreRangeOneKey-8      1000000              1808 ns/op             578 B/op         13 allocs/op
BenchmarkStoreRangeOneKey-8      1000000              1766 ns/op             578 B/op         13 allocs/op
BenchmarkStoreRangeOneKey-8      1000000              1800 ns/op             577 B/op         13 allocs/op
BenchmarkStoreRangeOneKey-8      1000000              1758 ns/op             578 B/op         13 allocs/op

Save another alloc on the one key path.
Copy link
Contributor

@gyuho gyuho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks.

@xiang90
Copy link
Contributor

xiang90 commented Aug 21, 2017

lgtm

@heyitsanthony heyitsanthony merged commit 0bf4046 into etcd-io:master Aug 21, 2017
@heyitsanthony heyitsanthony deleted the mvcc-revisions branch August 21, 2017 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants