Branch-free time handling - #640
Open
benjoffe wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello,
This change to the time-handling logic results in:
to_civil_datetime_offset_conversion- around 3% by my measurementsIn regards to point 2, this is laid out in more detail in Issue #638.
Since this resolves the issue noted there, the benchmark which measures the varying performance is unlikely required in Jiff's codebase. To use the benchmark though, you can see the branch here:
benjoffe@71a2210
If you take the branch here, rebase it off that one, then run the benchmark
to_civil_datetime_offset_conversionbefore-and-after, you should see that the timings are now all very consistent, instead of changing based on data-set range.If this gets merged, I think #638 could be closed as no longer needed.
Please let me know if anything about this has been poorly explained, or if you have any questions.
Also, as always, the URL in the comment is totally optional. It points to this draft blog post which will have more detailed information: https://www.benjoffe.com/fast-time-of-day
Off-topic, but related to my last PR: The full blog post detailing the day-of-week algorithm is now published in the last hour or so: https://www.benjoffe.com/fast-day-of-week
Cheers,
Ben