https://www.cppnow.org
https://www.linkedin.com/company/cppnow
---
Speeding Date: Implementing Fast Calendar Algorithms - Cassio Neri - CppNow 2023
Slides: https://github.com/boostcon
---
This talk concerns calendar algorithms which I implemented in the Linux Kernel and in libstdc++ (<chrono>). One of them has been ported to C# and released in .NET 7. I show some optimisation results that explain why these algorithms are so suited for modern CPUs. These optimisations might be useful elsewhere since benchmark results show that our algorithms perform considerably faster than counterparts in libc++, boost, OpenJDK, Android phones and other popular open source libraries.
Most results are strength reduction techniques not used by any optimising compiler. Another technique breaks a data-dependency that commonly appears in division/modulus calculations and by doing so, we improve instruction level parallelism in superscalar CPUs. Also in the talk:
1) An implementation of the humble std::chrono::year::is_leap that's usually 3x faster than virtually every other implementation out there.
2) A one-line C/C++ expression that yields the last day of the month M for 1 <= M <= 12 and M != 2. It doesn't use either branches (if or switch) or look-up tables just... (Shush! No spoilers here.)
3) A brief history of our most used calendar, from its Roman origins, its Greek and Egyptian influences, up to its final form taken in the 16th century. Decisions made hundreds of years ago have a deep impact on the performance of calendar algorithms that run today. A fascinating subject, full of story telling that can amuse guests at any dinner party.
---
Cassio Neri
Cassio Neri holds a PHD in Applied Mathematics from University of Paris Dauphine. He has been professionally coding in C++ for more than 15 years but his coding experience has started when he was 11. He currently works in the financial industry in London but has previously worked as a lecturer of Mathematics for more than a decade.
Cassio has authored a few research articles and has published them on peer-reviewed journals on Mathematics (there's an equation named after him), Finance, Computer Science and C++.
---
Video Sponsors: think-cell and Bloomberg Engineering
Audience Audio Sponsors: Innoplex and Maryland Research Institute
---
Videos Filmed & Edited By Bash Films: https://bashfilms.com/
YouTube Channel Managed & Optimized By Digital Medium Ltd: https://events.digital-medium.co.uk
---
CppNow 2024
https://www.cppnow.org
https://twitter.com/cppnow
---
#boost #cpp #cppprogramming