Repository navigation
perf(arrow-array): skip DataType drop glue in generic temporal converters - #11896
Conversation
|
run benchmark cast_timestamp env:
BENCH_FILTER: "(timezone_control|no_nulls)" |
|
🤖 Benchmark starting (GKE) | trigger Target: cast_timestamp Sharding factor: 1 (1 workers). Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark cast_timestamp env:
BENCH_FILTER: "(timezone_control|no_nulls)"
resources:
arch: amd64 |
|
🤖 Benchmark starting (GKE) | trigger Target: cast_timestamp Sharding factor: 1 (1 workers). Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
resources:
arch: amd64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark cast_timestamp env:
BENCH_FILTER: "(timezone_control|no_nulls)"
RUSTFLAGS: "-C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6" |
|
🤖 Benchmark starting (GKE) | trigger Target: cast_timestamp Sharding factor: 1 (1 workers). Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
RUSTFLAGS: -C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark cast_timestamp env:
BENCH_FILTER: "(timezone_control|no_nulls)"
RUSTFLAGS: "-C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6"
resources:
arch: amd64 |
|
🤖 Benchmark starting (GKE) | trigger Target: cast_timestamp Sharding factor: 1 (1 workers). Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
RUSTFLAGS: -C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6
resources:
arch: amd64
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: cast_timestamp Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
RUSTFLAGS: -C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6
resources:
arch: amd64
shards: 1
DetailsPer-runner informationcast_timestamp — shard 1/1Node: gk3-benchmark-cluster-nap-1tkeimc9-23b6a6b7-7fvl Instance: c4-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench cast_timestampCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: cast_timestamp Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
resources:
arch: amd64
shards: 1
DetailsPer-runner informationcast_timestamp — shard 1/1Node: gk3-benchmark-cluster-nap-1tkeimc9-780c1e5a-slsv Instance: c4-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench cast_timestampCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: cast_timestamp Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
shards: 1
DetailsPer-runner informationcast_timestamp — shard 1/1Node: gk3-benchmark-cluster-nap-3koj4ru6-4fd0bf1d-bm9x Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench cast_timestampCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: cast_timestamp Comparing as-datetime-skip-drop (eecee00) to 9d7f294 (merge-base) diff Run configurationrun benchmark cast_timestamp
env:
BENCH_FILTER: (timezone_control|no_nulls)
RUSTFLAGS: -C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6
shards: 1
DetailsPer-runner informationcast_timestamp — shard 1/1Node: gk3-benchmark-cluster-nap-3koj4ru6-4fd0bf1d-tt7c Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench cast_timestampCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
Which issue does this PR close?
as_datetime::<T>and related generic converters callDataTypedrop glue on every value #11895.Rationale for this change
The issue describes the problem.
What changes are included in this PR?
as_datetime,as_datetime_with_timezone,as_timeandas_durationwrap theT::DATA_TYPEtemporary inManuallyDrop, so no drop glue runs per value.as_durationwasn't in the issue, but it has the same per-value drop.Are these changes tested?
Existing tests cover the converters through
PrimitiveArray::value_as_datetime,value_as_timeand thearrow-casttimestamp casts. Behavior is unchanged.Timestamp casts with a time zone call
as_datetime_with_timezone::<T>per value. In the bot'scast_timestampruns, casts toDate32got 1.04x to 1.26x faster on both machines. Casts toTime32/Time64got up to 1.10x faster on Neoverse-V2 and didn't change on Xeon.All runs
These are speedups over
mainfor all 20 time zone cases and the 20 cases without a time zone, which don't call the changed code. The aligned runs add-C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6.Date32, time zoneTime32/Time64, time zoneOn Apple M5 Max with thin LTO, local runs gave 1.10x to 1.36x for
Date32and 1.08x to 1.19x forTime32/Time64.format_temporaldidn't change (0.97x to 1.00x), because formatting costs far more per value than the call this removes. I haven't profiled whyTime32/Time64doesn't gain on Xeon.In the thin-LTO
cast_timestampbinary on aarch64,drop_glue::<DataType>is no longer called from anytimestamp_to_timeoradjust_timestamp_to_timezonemonomorphization. On x86_64, I checked aunary_optkernel overas_datetime::<TimestampNanosecondType>before linking. It now compiles to the same 1166 instructions as the same kernel overtimestamp_ns_to_datetime.Are there any significant user-facing changes?
No.
AI Disclosure
I wrote this PR with help from Claude but understand and support the core approach, implementation, and test coverage.