-
Notifications
You must be signed in to change notification settings - Fork 454
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
[dbnode] Remove implicit cloning of time ranges to reduce Allocs #2178
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2178 +/- ##
========================================
Coverage ? 72.2%
========================================
Files ? 1019
Lines ? 88456
Branches ? 0
========================================
Hits ? 63907
Misses ? 20255
Partials ? 4294
Continue to review full report at Codecov.
|
type ShardTimeRanges map[uint32]xtime.Ranges | ||
type ShardTimeRanges interface { | ||
// Get time ranges for a shard. | ||
Get(shard uint32) xtime.Ranges |
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 we make this Get(shard uint32) (xtime.Ranges, bool)
?
The amount of times we should have tested whether Get returns nil or not but forgot and then it panics (because someone didn't check whether it was nil before calling on it) is just too high to avoid making this change IMO.
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
What this PR does / why we need it:
Fixes #2170 . Removes implicit cloning of time ranges. Adds explicit cloning to the API.
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: