I need a very basic key-value store for java. I started with a HashMap but it seems that HashMap is somewhat space inefficient (I\'m storing ~20 million records, and seems t
Consider Koloboke Collections, which is up to 2 times faster than Trove according to various tests:
if configured to consume the same memory as Trove. Or alternatively, you can think it consumes considerably lesser memory if configured to be equally fast to Trove.
If you want to persist the map between JVM runs with very quick bootstrap, you might also be interested in Chronicle-Map which stores String
s in UTF-8 by default (so you shouldn't bother with conversions String
<-> byte[]
as with Koloboke/Trove). Chronicle-Map is ultra fast for persisted key-value store, but a bit slower that Koloboke and even Trove.