[ 
https://issues.apache.org/jira/browse/KUDU-2847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16861508#comment-16861508
 ] 

Todd Lipcon commented on KUDU-2847:
-----------------------------------

Couple ideas:
- convert the bitmap to a list of set indexes once per block, and then iterate 
over the list of indexes once per column
- implement the above with some smarter code vs iterating over and testing each 
bit (eg 
https://lemire.me/blog/2018/03/08/iterating-over-set-bits-quickly-simd-edition/)
-- maybe worth special casing some code for runs of 'all-set' and 'all-unset' 
since a lot of SQL predicates tend to be either very dense or very sparse
- codegen for SerializeRowBlock to operate by row instead of by column would 
probably yield large benefits as well

> Optimize iteration over selection vector in SerializeRowBlock
> -------------------------------------------------------------
>
>                 Key: KUDU-2847
>                 URL: https://issues.apache.org/jira/browse/KUDU-2847
>             Project: Kudu
>          Issue Type: Improvement
>          Components: perf, tserver
>            Reporter: Todd Lipcon
>            Priority: Major
>
> Currently, SerializeRowBlock operates column-by-column, which means we have 
> to iterate over the selection bitmap once for each column. This code isn't 
> particularly well optimized -- in TPCH Q6, about 10% of CPU is spent in 
> BitmapFindFirst. We should look at alternate implementations here that better 
> amortize the bitmap iteration cost across all of the columns and generally 
> micro-optimize it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to