Skip to content

Branch-free time handling - #640

Open
benjoffe wants to merge 1 commit into
BurntSushi:masterfrom
benjoffe:branchfree_time
Open

Branch-free time handling#640
benjoffe wants to merge 1 commit into
BurntSushi:masterfrom
benjoffe:branchfree_time

Conversation

@benjoffe

Copy link
Copy Markdown
Contributor

Hello,

This change to the time-handling logic results in:

  1. a small improvement to to_civil_datetime_offset_conversion - around 3% by my measurements
  2. more notably, the performance of datetime conversion should now be fully branch-free

In 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_conversion before-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant