Java Collection Framework Koloboke detailed

Source: Internet
Author: User

Java Collection Framework Koloboke detailed Chszs, not allowed to reprint without the Bo master. Permission to reprint should be marked by the author and blog home: Http://blog.csdn.net/chszs

The goal of Koloboke is to replace the standard Java collection and flow APIs to provide a more efficient implementation. The current version of Koloboke is mainly to replace Java.util.HashSet and Java.util.HashMap.

Koloboke provides an implementation of a complete set of primitive types, which avoids costly boxing/unboxing operations and saves the raw type of memory that is consumed by boxing.

In Koloboke, HashSet and HashMap are faster than other specialized implementations (such as GS collections, Fastutil, HTTP & Trove) because:

1) Koloboke uses less memory per entry than other libraries
2) Koloboke goal is to store keys and values in the same row cache
3) All methods are optimized rather than delegated to the framework class (Skeleton Class) like the Abstractset or Abstractmap classes

Koloboke's official website: http://chronicle.software/products/koloboke-collections/

Characteristics of the Koloboke:

1) Excellent compatible Java collection framework (Jcf,java collections Framework)
2) All original specialized collection classes inherit basic interfaces (such as collection, Set, Map)
3) can be used to replace the standard JCF
4) Koloboke API for Java 6 and Java 7 new method for forward compatibility with Java 8
5) fast-failing semantics
6) Support for null keys (optional), just like the Float.nan and Double.NaN keys in Java.util.HashMap.

When do I use chronicle map or Koloboke map?

Scenes using the Chronicle map:
1) storage of more than 500 million entry
2) Distributing the map between processes
3) using out-of-heap memory (off-heap memories), because the keys and values occupy too much memory, the JVM suffers from GC

Koloboke is a better choice when you do not want to share data between processes, and the storage entry is within 500 million lines.

The latest version of Koloboke is 0.6. Version 8. It can be used from the MAVEN repository:

<dependency>    <groupId>net.openhft</groupId>    <artifactId>koloboke-api-jdk8</artifactId>    <version>0.6.8</version></dependency><dependency>    <groupId>net.openhft</groupId>    <artifactId>koloboke-impl-jdk8</artifactId>    <version>0.6.8</version></dependency>

Gradle Dependent for

dependencies {    // `jdk8` instead of `jdk6-7` if you use Java 8    compile ‘net.openhft:koloboke-api-jdk6-7:0.6.8‘    runtime ‘net.openhft:koloboke-impl-jdk6-7:0.6.8‘}

can also be downloaded here: https://github.com/OpenHFT/Koloboke/releases

Java Collection Framework Koloboke detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.