simonvandel opened a new pull request, #8855:
URL: https://github.com/apache/arrow-datafusion/pull/8855

   BTreeMap gives stable iteration order, so we don't need to sort
   
   Speeds up benchmarks in sql_planner.rs by 3-8%
   
   CC @matthewmturner who seems interested in planning performance
   
   <details>
   
   <summary>Bench results</summary>
   
   [~/code/arrow-datafusion/datafusion/core/benches]$ mold -run cargo bench 
--bench sql_planner --profile release-nonlto
   logical_select_one_from_700
                           time:   [3.9136 ms 3.9249 ms 3.9376 ms]
                           change: [-8.2901% -7.9287% -7.5315%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     2 (2.00%) low mild
     2 (2.00%) high mild
     2 (2.00%) high severe
   
   physical_select_one_from_700
                           time:   [20.597 ms 20.803 ms 21.054 ms]
                           change: [-8.4809% -6.9620% -5.4361%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 7 outliers among 100 measurements (7.00%)
     3 (3.00%) high mild
     4 (4.00%) high severe
   
   Benchmarking logical_trivial_join_low_numbered_columns: Warming up for 
3.0000 s
   Warning: Unable to complete 100 samples in 5.0s. You may wish to increase 
target time to 9.7s, enable flat sampling, or reduce sample count to 50.
   logical_trivial_join_low_numbered_columns
                           time:   [1.9051 ms 1.9084 ms 1.9119 ms]
                           change: [-4.0367% -3.6755% -3.2992%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 12 outliers among 100 measurements (12.00%)
     7 (7.00%) high mild
     5 (5.00%) high severe
   
   logical_trivial_join_high_numbered_columns
                           time:   [1.9942 ms 2.0077 ms 2.0297 ms]
                           change: [-5.6552% -4.9685% -3.9991%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 10 outliers among 100 measurements (10.00%)
     1 (1.00%) low mild
     2 (2.00%) high mild
     7 (7.00%) high severe
   
   logical_aggregate_with_join
                           time:   [2.7620 ms 2.7675 ms 2.7740 ms]
                           change: [-7.3856% -7.0534% -6.6934%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 8 outliers among 100 measurements (8.00%)
     5 (5.00%) high mild
     3 (3.00%) high severe
   
   physical_plan_tpch      time:   [7.0284 ms 7.0988 ms 7.1760 ms]
                           change: [-5.1444% -3.0485% -1.1432%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 12 outliers among 100 measurements (12.00%)
     8 (8.00%) high mild
     4 (4.00%) high severe
   
   </details>
   
   ## 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. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   Relates to https://github.com/apache/arrow-datafusion/issues/5637
   
   ## 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.  
   -->
   
   Planning time of Datafusion is slow.
   
   ## 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.
   -->
   
   Removed a sort by switching to BTreeSet instead of HashSet.
   
   ## Are these changes tested?
   
   Yes, by existing tests.
   
   <!--
   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)?
   -->
   
   ## Are there any user-facing changes?
   
   Faster planning.
   
   <!--
   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 add the `api 
change` label.
   -->
   


-- 
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]

Reply via email to