You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "MassivePizza (via GitHub)" <gi...@apache.org> on 2026/07/07 13:03:02 UTC

[PR] Cache encoded field name in FieldEncoder [arrow-rs]

MassivePizza opened a new pull request, #10296:
URL: https://github.com/apache/arrow-rs/pull/10296

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.
   -->
   
   - Closes #10295.
   
   # Rationale for this change
   
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   See issue.
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   See issue.
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   
   If this PR claims a performance improvement, please include evidence such as benchmark results.
   -->
   Should be covered by existing tests.
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   
   If there are any breaking changes to public APIs, please call them out.
   -->
   No.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache encoded field name in FieldEncoder [arrow-rs]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #10296:
URL: https://github.com/apache/arrow-rs/pull/10296#issuecomment-4999771765

   thanks @MassivePizza 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache encoded field name in FieldEncoder [arrow-rs]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #10296:
URL: https://github.com/apache/arrow-rs/pull/10296


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache encoded field name in FieldEncoder [arrow-rs]

Posted by "MassivePizza (via GitHub)" <gi...@apache.org>.
MassivePizza commented on PR #10296:
URL: https://github.com/apache/arrow-rs/pull/10296#issuecomment-4971159428

   Sidenote: I also looked at using this caching for DictionaryArrays of String, but our product doesn't really generate those. 
   We'd have to add an optimization pass in Datafusion to actually produce those for e.g. `CASE WHEN` that evaluate to constant strings.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache encoded field name in FieldEncoder [arrow-rs]

Posted by "MassivePizza (via GitHub)" <gi...@apache.org>.
MassivePizza commented on PR #10296:
URL: https://github.com/apache/arrow-rs/pull/10296#issuecomment-5001638074

   Just tried one and got an improvement, so probably noise.
   ```
   bench_nullable_struct   time:   [8.0262 ms 8.0643 ms 8.1052 ms]
                           change: [−8.1292% −7.4883% −6.8732%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     5 (5.00%) high mild
     1 (1.00%) high severe
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache encoded field name in FieldEncoder [arrow-rs]

Posted by "MassivePizza (via GitHub)" <gi...@apache.org>.
MassivePizza commented on PR #10296:
URL: https://github.com/apache/arrow-rs/pull/10296#issuecomment-4970318348

   Right, I forgot to add those. My org has an internal bench for just encode_string and an integration bench for a struct with standard-length field names. Will sanitize those and commit here.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cache encoded field name in FieldEncoder [arrow-rs]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #10296:
URL: https://github.com/apache/arrow-rs/pull/10296#issuecomment-4976654859

   I ran `cargo bench -p arrow --bench json_writer --features "test_utils json"` locally with the bench changes on main then on this branch:
   
   ```diff
   bench_integer           time:   [2.4510 ms 2.4599 ms 2.4684 ms]
   +                       change: [−4.3634% −3.9909% −3.6416%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 17 outliers among 100 measurements (17.00%)
     8 (8.00%) low severe
     8 (8.00%) low mild
     1 (1.00%) high mild
   
   bench_float             time:   [2.9815 ms 2.9848 ms 2.9883 ms]
   +                       change: [−6.1623% −5.8905% −5.6521%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 7 outliers among 100 measurements (7.00%)
     7 (7.00%) high mild
   
   bench_string            time:   [7.4536 ms 7.4639 ms 7.4741 ms]
   +                       change: [−2.7981% −2.5786% −2.3719%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 1 outliers among 100 measurements (1.00%)
     1 (1.00%) low mild
   
   bench_mixed             time:   [10.658 ms 10.680 ms 10.705 ms]
   +                       change: [−7.4853% −7.1895% −6.9014%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 1 outliers among 100 measurements (1.00%)
     1 (1.00%) high severe
   
   bench_mixed_longname    time:   [5.1188 ms 5.1363 ms 5.1558 ms]
   +                       change: [−28.954% −28.551% −28.156%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 9 outliers among 100 measurements (9.00%)
     6 (6.00%) high mild
     3 (3.00%) high severe
   
   bench_shortmixed_longname
                           time:   [4.2039 ms 4.2093 ms 4.2148 ms]
   +                       change: [−29.683% −29.502% −29.324%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 1 outliers among 100 measurements (1.00%)
     1 (1.00%) high mild
   
   bench_dict_array        time:   [3.6259 ms 3.6349 ms 3.6446 ms]
   +                       change: [−1.7944% −1.5260% −1.2328%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     3 (3.00%) high mild
     3 (3.00%) high severe
   
   bench_struct            time:   [17.071 ms 17.102 ms 17.135 ms]
   +                       change: [−2.3589% −2.0595% −1.7670%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 7 outliers among 100 measurements (7.00%)
     1 (1.00%) low mild
     4 (4.00%) high mild
     2 (2.00%) high severe
   
   bench_nullable_struct   time:   [8.9790 ms 9.0044 ms 9.0332 ms]
   -                       change: [+10.464% +10.847% +11.310%] (p = 0.00 < 0.05)
                           Performance has regressed.
   Found 8 outliers among 100 measurements (8.00%)
     2 (2.00%) high mild
     6 (6.00%) high severe
   
   bench_list              time:   [25.390 ms 25.439 ms 25.492 ms]
   -                       change: [+7.6416% +8.2171% +8.7591%] (p = 0.00 < 0.05)
                           Performance has regressed.
   Found 4 outliers among 100 measurements (4.00%)
     3 (3.00%) high mild
     1 (1.00%) high severe
   
   bench_nullable_list     time:   [5.4186 ms 5.4606 ms 5.5029 ms]
   -                       change: [+4.2082% +5.2798% +6.3134%] (p = 0.00 < 0.05)
                           Performance has regressed.
   
   bench_struct_list       time:   [2.5047 ms 2.5144 ms 2.5257 ms]
   +                       change: [−4.4805% −3.7484% −3.0407%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 9 outliers among 100 measurements (9.00%)
     7 (7.00%) high mild
     2 (2.00%) high severe
   
   f64_to_string           time:   [2.1164 ms 2.1199 ms 2.1236 ms]
   +                       change: [−3.0236% −2.7448% −2.4816%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 7 outliers among 100 measurements (7.00%)
     7 (7.00%) high mild
   
   Benchmarking f32_to_string: 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.
   f32_to_string           time:   [1.1920 ms 1.1955 ms 1.1995 ms]
                           change: [+0.5809% +0.8944% +1.2082%] (p = 0.00 < 0.05)
                           Change within noise threshold.
   
   Benchmarking i64_to_string: Warming up for 3.0000 s
   Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 7.9s, enable flat sampling, or reduce sample count to 50.
   i64_to_string           time:   [1.5718 ms 1.5768 ms 1.5818 ms]
                           change: [−1.4256% −1.0300% −0.6526%] (p = 0.00 < 0.05)
                           Change within noise threshold.
   Found 2 outliers among 100 measurements (2.00%)
     2 (2.00%) high mild
   
   Benchmarking i32_to_string: Warming up for 3.0000 s
   Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 7.4s, enable flat sampling, or reduce sample count to 50.
   i32_to_string           time:   [1.4531 ms 1.4576 ms 1.4621 ms]
   +                       change: [−2.2713% −1.8183% −1.3782%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 7 outliers among 100 measurements (7.00%)
     6 (6.00%) high mild
     1 (1.00%) high severe
   
   mixed_numbers_to_string time:   [7.1889 ms 7.2025 ms 7.2169 ms]
   -                       change: [+4.0331% +4.3315% +4.6342%] (p = 0.00 < 0.05)
                           Performance has regressed.
   Found 5 outliers among 100 measurements (5.00%)
     4 (4.00%) high mild
     1 (1.00%) high severe
   ```
   
   Can see clear improvements on the longname ones 🚀
   
   I think the other regressions are just noise 🤔 
   
   Curious if you see similar results


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org