andygrove commented on PR #11482: URL: https://github.com/apache/arrow-rs/pull/11482#issuecomment-6949198574
> I ran the test matrix and the `named_timezone` bench for this PR at [f0e742b](https://github.com/apache/arrow-rs/commit/f0e742b21660b3f369257c7da90dab9bc77c07d0) (it still merges cleanly onto `main` [4f1ed42](https://github.com/apache/arrow-rs/commit/4f1ed42f7a1fb76d090ec1351cfdb6e904f59f0b)). I also tried it against jiff 1.0, since [#9183](https://github.com/apache/arrow-rs/issues/9183) proposes moving to it. > > **Tests** (rustc 1.99.1 from `rust-toolchain.toml`): all green. > > Command Result > `cargo test -p arrow --features chrono-tz,jiff` / `--features chrono-tz` 182 / 182 passed > `cargo test -p arrow-array --features jiff` / `--features chrono-tz,jiff` 979 / 981 passed, 2 ignored > `cargo test -p arrow-cast -p arrow-csv -p arrow-json --features arrow-array/jiff` 725 passed > `cargo clippy -p arrow-array -p arrow --all-targets --features arrow-array/jiff,arrow/chrono-tz -- -D warnings` clean > `cargo check -p arrow-array --no-default-features --features jiff` ok > **jiff 1.0.0 / jiff-tzdb 1.0.0**: the PR builds with two small changes, because `jiff_tzdb::VERSION` is now `&'static str` instead of `Option<&str>`. `tzdb_version()` returns `Some(jiff_tzdb::VERSION)`, and the test message drops `.unwrap_or("unknown")`. After that, everything above passes except `compare_with_chrono_tz::test_same_offsets`: tzdb 2026f differs from chrono-tz's 2025b in 23 more zones (`America/Sao_Paulo` and the other Brazilian zones, `America/Havana`/`Cuba`). The allowlist goes from 26 to 49 zones. That is expected data drift, not a bug, but the allowlist will need the update in the rebase. On performance, jiff 1.0 was within noise of 0.2.41 (rows marked † below). > > **Benchmarks**: `cargo bench -p arrow --bench named_timezone --features chrono-tz -- --save-baseline chrono`, then `--features chrono-tz,jiff -- --baseline chrono`. Each process was pinned to one P-core (`taskset`) with criterion `--warm-up-time 1 --measurement-time 3`, on an i9-14900F running Linux 7.0. The machine is a shared workstation and was not idle (load average 6–18 on 32 threads). I ran the kernel groups twice, in opposite order, and show the spread. Values are the ratio of jiff to chrono-tz medians; below 1 means jiff is faster. > > DST zones (`America/Los_Angeles`, `Europe/London`): > > Bench 1970–2038 2038–2100 2100–2300 > `tz_offset_from_utc_datetime` 0.66–0.84 † 1.90–1.95 † 1.70–1.74 > `tz_offset_from_local_datetime` 0.71–0.82 † 2.14–2.37 † 2.31 > `date_part_hour/1M` **1.09–1.19** † 1.75–2.40 † 1.58–1.64 > `cast_timestamp_to_utf8/128K` **1.05–1.11** † 1.29–1.42 † 1.21–1.26 ‡ > Fixed-offset zones (`UTC`, `Asia/Tokyo`): 0.30–1.04 on every row and range. `tz_parse`: 0.68–0.75. ‡ In the first pass, the 2100–2300 kernel groups ran last, during a load spike, and read 1.45–2.01 (cast, all zones) and 1.16 (Tokyo `date_part`). The rerun gave 1.21–1.26 for DST zones and 0.81–1.02 for fixed-offset zones, so I treat the first pass as noise. > > Two observations against the 5% gate proposed on [#9183](https://github.com/apache/arrow-rs/issues/9183): > > 1. After 2038 the cost matches the 1.7–2.4x already reported: offsets come from the POSIX rule instead of a table. > 2. For 1970–2038 in DST zones, the offset lookups are 16–34% _faster_ with jiff, but `date_part` and `cast` are still 5–19% _slower_. This holds in all three runs, on jiff 0.2.41 and 1.0. Both kernels resolve offsets through `offset_from_utc_datetime`. A variant of the lookup bench with dense input (1 day of instants) is still faster for LA (0.75x), so input locality does not explain it. The cost seems to sit outside the lookup itself, possibly in the copies of the larger `TzOffset` (24 bytes, holding `Tz`). That is a guess I have not profiled. It may be worth adding a kernel-level row for 1970–2038 to the gate, since a lookup-only gate would pass today. > > Happy to rerun this on each revision. > > (Disclosure: I used an AI assistant to run and tabulate these measurements. I reviewed the commands and results.) Thanks for this. I am running fresh benchmarks now and will. update PR description when done. Will take an hour or so. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
