densh / scala-offheap

Experimental type-safe off-heap memory for Scala.
BSD 3-Clause "New" or "Revised" License
532 stars 35 forks source link

Optimize boolean arrays to use 1 bit per element rather than 1 byte #71

Closed densh closed 9 years ago

densh commented 9 years ago

Currently we use quite inefficient scheme for storing booleans in arrays storing 1 byte per element. It shouldn't be too hard to shrink that overhead to 1 bit per element.

andreaTP commented 9 years ago

:+1:

densh commented 9 years ago

Boolean arrays in C also use 1 byte per element. If we want to have C-friendly data layout we have to stick to this convention. I think it's better to have a separate BitSet implementation for this use case like the one @andreaTP has been working on.