-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
storage: avoid allocations for range-local key generation #13455
storage: avoid allocations for range-local key generation #13455
Conversation
Review status: 0 of 15 files reviewed at latest revision, 2 unresolved discussions. pkg/storage/replica_state.go, line 38 at r1 (raw file):
The concurrency issue isn't a big deal in practice as we only call the methods on pkg/storage/replica_state.go, line 39 at r1 (raw file):
I'm not fond of this type name. Suggestions? Comments from Reviewable |
c8344ea
to
e70865f
Compare
Crap. Data races. Hold off on looking at this. |
e70865f
to
680ed26
Compare
Fixed the race. RFAL. |
, although this seems like a fairly big change for a 2% reduction in allocations. Reviewed 12 of 15 files at r1, 3 of 3 files at r2. pkg/storage/replica_raftstorage.go, line 358 at r2 (raw file):
It's called without even having access to a pkg/storage/replica_state.go, line 39 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
Comments from Reviewable |
Well, large parts of it are fairly mechanical. Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. pkg/storage/replica_raftstorage.go, line 358 at r2 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Well, we could pass the pkg/storage/replica_state.go, line 39 at r1 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Ok. I'll change in a bit. Comments from Reviewable |
680ed26
to
a7a0816
Compare
Reorganized the range-local key generation code to utilize a new RangeIDPrefixBuf abstraction. Use this new functionality in replicaStateLoader to avoid allocations when loading and saving range-local data. This removes 2.2% of allocations in a write-only workload.
a7a0816
to
3925e90
Compare
Reorganized the range-local key generation code to utilize a new
RangeIDPrefixBuf abstraction. Use this new functionality in
replicaStateKeys to avoid allocations when loading and saving
range-local data.
This removes 2.2% of allocations in a write-only workload.
This change is