~/talk

Implementing Fast Calendar Algorithms: Speeding Date

Talkat C++ on Sea 2023 · 2023-06-28..06-30· [c-and-cpp]
links:none on file
slides:none on file

Presents concrete, branch-free algorithms that map days-since-epoch to year/month/day using a computational-calendar transform plus integer arithmetic and reciprocal multiplication (Montgomery) to remove expensive divisions. Claims include 3× faster is_leap vs common implementations, a one-line branchless last-day formula for months ≠ 2, end-to-end code that runs in single-digit nanoseconds, and real-world adoption — in the Linux kernel, libstdc++ and .NET — with fewer multiplications and better parallelism on modern CPUs.

AI-written summary · about

  1. 0:00Introduction
  2. 2:31Talk overview
  3. 8:20Modern calendar algorithms
  4. 10:28Roman and Julian history
  5. 15:26Gregorian reform and leap years
  6. 18:25Optimizing leap year checks
  7. 22:42Last day of month
  8. 24:54Mathematical framework
  9. 30:07Generalizing calendar calculations
  10. 31:55Framework for Julian calendar
  11. 35:26Computational calendar concept
  12. 37:59Mapping to calendars
  13. 41:11Date conversion algorithm
  14. 44:03Days since epoch
  15. 45:27Contributions and performance
  16. 46:50Optimizing division
  17. 50:48Montgomery reduction
  18. 52:13Historical bits and compilers
  19. 55:08Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.