jiff/crates
Andrew Gallant 269aee43ef
shared: attempt a faster date <-> rate die algorithm
This comes from:
https://www.benjoffe.com/fast-date-64

More specifically, the code is here:
7fcf82b07d/algorithms/benjoffe_fast64.hpp

But the benchmarks don't show an improvement:

```
$ critcmp base x01
group                                                   base                                   x01
-----                                                   ----                                   ---
civil_datetime/to_timestamp_static/bundled/jiff         1.00     10.5±0.09ns        ? ?/sec    1.03     10.9±0.07ns        ? ?/sec
civil_datetime/to_timestamp_static/zoneinfo/jiff        1.00     10.4±0.09ns        ? ?/sec    1.03     10.8±0.07ns        ? ?/sec
timestamp/to_civil_datetime_offset_conversion/jiff      1.00      4.4±0.05ns        ? ?/sec    1.03      4.6±0.03ns        ? ?/sec
```

I ran the benchmarks like this:

```
cd bench
```

Before the change:

```
cargo bench --'(civil_datetime/to_timestamp_static|timestamp/to_civil_datetime_offset_conversion).*jiff' --save-baseline base
```

And then after the change:

```
cargo bench --'(civil_datetime/to_timestamp_static|timestamp/to_civil_datetime_offset_conversion).*jiff' --save-baseline x01
```

Then I used [`critcmp`] to compare them:

```
critcmp base x01
```

It's very possible I didn't port it correctly. I haven't scrutinized the
codegen. It's also possible that there is an improvement, but that it's
hard to write a benchmark using Jiff APIs to observe it.

(Note that I left out the ARM-specific bits. I'm testing this on x86-64.
I wanted to test there first before digging into the platform specific
optimizations.)

[`critcmp`]: https://github.com/BurntSushi/critcmp
2025-11-26 14:31:58 -05:00
..
jiff-cli doc: typo fixing 2025-11-06 16:11:16 -05:00
jiff-diesel doc: typo fixing 2025-11-06 16:11:16 -05:00
jiff-icu jiff-icu-0.2.2 2025-11-07 08:22:47 -05:00
jiff-sqlx doc: typo fixing 2025-11-06 16:11:16 -05:00
jiff-static shared: attempt a faster date <-> rate die algorithm 2025-11-26 14:31:58 -05:00
jiff-tzdb jiff-tzdb-0.1.4 2025-03-22 20:38:00 -04:00
jiff-tzdb-platform jiff-tzdb-platform-0.1.3 2025-03-22 20:39:37 -04:00
jiff-wasm crates: move all sub-crates into crates/ directory 2025-02-02 14:10:48 -05:00