What is Koloboke

Koloboke aims to replace the standard Java collections and streams  with more efficient implementations.  The current version of Koloboke focuses on replacing java.util.HashSet and java.util.HashMap.

How it Works

Koloboke provides a complete set of primitive type implementations for each collection. Its able to avoid the expensive boxing/unboxing of primitives and saves memory for boxed primitive objects.

Hash Sets and Maps in Koloboke are faster than other specialised implementations, such as GS collections, fastutil, HPPC & Trove, this is because:

  • Koloboke uses less memory per entry, than any other library.
  • Koloboke aims to store its keys and values on the same cache line.
  • All methods are implemented optimally, rather than delegated to skeleton classes like AbstractSet and AbstractMap.
  • Koloboke works from generated code which has been optimised for performance.

These enhancements improve our performance by an additional 5-10%.

For more information on the “time – memory trade off”, click here

Features

  • Excellent compatibility with the Java Collections Framework (JCF):
  • All primitive specialisation collections extend basic interfaces (Collection, Set, Map)
  • Can be used as a drop-in replacement for standard JCF collections.
  • The Koloboke API for Java 6 and 7 is forward-compatible with all methods new in Java 8
  • Fail-fast semantics.
  • null keys are (optionally) supported, just like in java.util.HashMap
  • Float.NaN and Double.NaN keys are treated consistently with their equivilant boxed versions ( all NaNs are considered equal )

API:

  • Koloboke’s API consists exclusively of interfaces and static factory methods.
  • Every interface is provided with dozens of factory methods.
  • Supports the majority of Java 8 Collections API additions ( everything with the exception of streams and spliterators) is back ported to the API for Java 6 and 7.
  • Koloboke contains some useful extension methods that go beyond the Java 8 Collections API.

Koloboke or Chronicle

When to use Chronicle Map or Koloboke Map

We suggest you use Chronicle Map if you need to :

  • store more than half a billion entries.
  • distribute the map between processes.
  • use off-heap memory, because your keys/values take too much memory and the Jvm suffers from GC

Koloboke is ideal when you don’t have to share data between processes and you have less than half a billion entries.

Koloboke is designed for collections of primitives like List, Set, and Map. Chronicle Map is designed for a Map of data value types.

For More Information

MavenDownload
GitHubSource Code
ReleaseDocumentation
ProductRoadmap
JavaDocJava 6
JavaDocJava 7
JavaDocJava 8
Stack OverflowQuestion

[/vc_column]