-
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] Decode perf time ops #2176
Conversation
return nil, false | ||
} | ||
|
||
scheme := s[u] |
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.
Do you think it's worth checking that 0 <= u < len(s)
or is that being a bit too defensive?
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.
Hmm yeah - I'm also not totally sure. We always new the schemes array via newTimeEncodingSchemes
which ensures the array is size of unitCount
, which means we know u
will be valid in it. But since technically TimeEncodingSchemes
could be created manually maybe it is safest to just check to be especially safe against an invalid index err.
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 /w 2 small nits
What this PR does / why we need it:
Decode operation optimizations such as changing
time.Time
toint64
operations. The 4 rightmost pink blocks are time operations, each ~10ms, which have been removed.Speed improvements look to be about +22%
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?: