Kothar Labs Contact Me

CompactList
Sat, 24 Feb 2018 / projects / java / compactlist

A memory-efficient List<Long> for Java

CompactList implements the List<Long> interface, but internally it uses a tree of variable word-width segments to improve performance and memory usage compared to an ArrayList.

Performance tends to be worse for appends than an ArrayList but better for inserts. Memory usage is significantly reduced, even for incompressible random data where it approaches the memory use of an array of primitive longs (which happens to be the internal representation in this case).

There are some performance metrics over at the GitHub repository. My aim is to use this for the internal index representation in CSView, which already uses an earlier version of this data structure.

Comments | Read more...

Memory usage during random insert for CompactList and other List<Long> implementations