perf(arrow-cast): improve custom temporal formatting performance in ArrayFormatter - #10594
Open
lyne7-sc wants to merge 1 commit into
Open
perf(arrow-cast): improve custom temporal formatting performance in ArrayFormatter#10594lyne7-sc wants to merge 1 commit into
lyne7-sc wants to merge 1 commit into
Conversation
Jefffrey
approved these changes
Aug 9, 2026
Jefffrey
left a comment
Contributor
There was a problem hiding this comment.
can reproduce results locally 👍
format_temporal/date64/default
time: [321.48 µs 322.23 µs 323.09 µs]
+ change: [−2.6583% −2.0392% −1.4818%] (p = 0.00 < 0.05)
Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
7 (7.00%) high mild
4 (4.00%) high severe
format_temporal/date64/custom_short
time: [515.48 µs 517.51 µs 519.66 µs]
+ change: [−21.775% −21.467% −21.154%] (p = 0.00 < 0.05)
Performance has improved.
format_temporal/date64/custom_long
time: [880.49 µs 882.41 µs 884.21 µs]
+ change: [−32.212% −31.955% −31.705%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
format_temporal/timestamp/custom_long
time: [934.32 µs 937.06 µs 939.70 µs]
+ change: [−29.966% −29.722% −29.440%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
Benchmarking format_temporal/timestamp_tz/custom_long: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.0s, enable flat sampling, or reduce sample count to 60.
format_temporal/timestamp_tz/custom_long
time: [1.2028 ms 1.2077 ms 1.2126 ms]
+ change: [−24.125% −23.734% −23.338%] (p = 0.00 < 0.05)
Performance has improved.
Author
|
@Jefffrey thanks for your review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
ArrayFormatter currently reparses custom Chrono format strings for every temporal value.
As an ArrayFormatter is typically created once and reused for an array, the parsed format items can instead be prepared once when constructing the formatter and reused for every value.
What changes are included in this PR?
Are these changes tested?
Yes.
Are there any user-facing changes?
No. There are no public API or behavior changes.
Benchmarks