Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull does quite a big root-canal rework:
Date
internal representation is changed from(year: 21 bits, ordinal: 9 bits)
to(year: 21 bits, month: 4 bits, day: 5 bits)
datealgo
libraryThe results of this are performance gains:
As can be seen, the performance gains are quite sizeable. The only regressions are
from_ordinal_date
,ordinal
andto_ordinal_date
, all of which are obvious. Ordinal based operations are not terribly common, so I would expect the improvements in real world usage to be a clear net positive.Disclaimer: I am the creator of the
datealgo
library, although I do not claim credit for the algorithms themselves.NOTE: Pull is still a draft, so code has a bunch of
FIXME
comments and other things. Also, performance results are preliminary as benchmarks are noisy, so more careful benchmarking is still needed. However, I wanted to get this out early, in order to get feedback before completing the rest.