Dandandan commented on PR #15591:
URL: https://github.com/apache/datafusion/pull/15591#issuecomment-2888271159

   > OK... I guess it is due to the computation of `block_id` and 
`block_offset`.
   > 
   > I found a machine with similar inteal cores like the testing machine and 
profiled.
   > 
   > Then I found in the old and not so good intel core, the `/` and `%` are 
really expansive.
   > 
   > I am trying to optimize it, but still not sure if it the most important 
bottleneck
   > 
   > ```rust
   > impl GroupIndexOperations for BlockedGroupIndexOperations {
   >     fn get_block_id(group_index: usize, block_size: usize) -> usize {
   >         group_index / block_size
   >     }
   > 
   >     fn get_block_offset(group_index: usize, block_size: usize) -> usize {
   >         group_index % block_size
   >     }
   > }
   > ```
   
   we could enforce blocksize being a power of two so we can avoid the 
expensive div and mod operations?


-- 
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...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to