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

   # Which issue does this PR close?
   
   
   Closes #.
   
   # Rationale for this change
    
    This saves rehashing / reshuffling the hashmap when there are quite some 
distinct values.
     
   This is quite a bit faster:
   
   ```
    Benchmarking write_batch primitive/4096 values primitive:
                           time:   [1.0495 ms 1.0520 ms 1.0550 ms]
                           thrpt:  [167.22 MiB/s 167.70 MiB/s 168.09 MiB/s]
                    change:
                           time:   [-24.025% -22.929% -21.823%] (p = 0.00 < 
0.05)
                           thrpt:  [+27.916% +29.751% +31.622%]
                           Performance has improved.
   Benchmarking write_batch primitive/4096 values primitive non-null:     
                           time:   [826.87 µs 827.46 µs 828.10 µs]
                           thrpt:  [208.91 MiB/s 209.07 MiB/s 209.22 MiB/s]
                    change:
                           time:   [-36.274% -36.156% -36.056%] (p = 0.00 < 
0.05)
                           thrpt:  [+56.388% +56.633% +56.922%]
                           Performance has improved.
   ```
   
   # What changes are included in this PR?
   
   Adds an initial capacity for the hashmap.
   
   <!--
   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.
   -->
   
   # 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 add the `breaking 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to