Animesh Trivedi created ARROW-3891:
--------------------------------------

             Summary: [Java] Remove Long.bitCount with simple bitmap operations
                 Key: ARROW-3891
                 URL: https://issues.apache.org/jira/browse/ARROW-3891
             Project: Apache Arrow
          Issue Type: Sub-task
            Reporter: Animesh Trivedi
            Assignee: Animesh Trivedi


the `public int isSet(int index)` routine checks if the bit is set by calling 
Long.bitCount function. This is unnecessary and creates performance 
degradation. This can simply be replaced by bit shift and bitwise & operation. 

`return Long.bitCount(b & (1L << bitIndex));`

to 

`return (b >> bitIndex) & 0x01;` 



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

Reply via email to