Coder Social home page Coder Social logo

valery-barysok / koloboke Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leventov/koloboke

0.0 3.0 0.0 31.7 MB

Java Collections till the last breadcrumb of memory and performance

Home Page: http://chronicle.software/products/koloboke-collections

Java 100.00%

koloboke's Introduction

Koloboke Collections

This library is a carefully designed and efficient extension of the Java Collections Framework with primitive specializations and more. Java 6+. Apache 2.0 license.

Currently only hash sets and hash maps are implemented.

Features

  • Excellent compatibility with Java Collections Framework (JCF)
    • All primitive specialization collections extend basic interfaces (Collection, Set, Map),
      hence could be used as drop-in replacements of slow collections of boxed values
    • API for Java 6 and 7 is forward-compatible with all methods new in Java 8
    • Fail-fast semantics everywhere
    • null keys are (optionally) supported, just like in java.util.HashMap
    • Float.NaN and Double.NaN keys are treated consistently with boxed version (all NaNs are considered equal)
  • Performance
  • API quality
    • API consists exclusively of interfaces and static factory methods
    • Every interface is provided with dozens of factory methods
    • As already mentioned, major part of Java 8 Collections API additions (actually, everything except streams and spliterators) is backported to the API for Java 6 and 7
    • Some useful extension methods beyond Java 8 Collections API
    • Every public entity in the API is documented
  • More than half a million of automatically generated tests

Disadvantage

All this goodness for the cost of... the library is insanely fat. Currently it takes about 20 MB (and that's only hash sets and maps).

Ultra quick start

Add to your Gradle build script:

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'
}

Or Maven config (don't forget about jdk6-7/jdk8 suffix):

<dependencies>
    <dependency>
        <groupId>net.openhft</groupId>
        <artifactId>koloboke-api-jdk6-7</artifactId>
        <version>0.6.8</version>
    </dependency>
    <dependency>
        <groupId>net.openhft</groupId>
        <artifactId>koloboke-impl-jdk6-7</artifactId>
        <version>0.6.8</version>
        <scope>runtime</scope>
    </dependency>
<dependencies>

Or similarly for your favourite build system. Or download jars of the latest release.

Then you can start using collections. Replace all lines like

Map<Integer, Integer> map = new HashMap<>();

with

Map<Integer, Integer> map = HashIntIntMaps.newMutableMap();

Next step: see [the table of equivalents of JDK collection patterns] (http://openhft.github.io/Koloboke/api/0.6/java8/index.html#jdk-equivalents).


Satellite projects

  • JPSG -- Java Primitive Specializations Generator
  • Benchmarks -- Many different JMH benchmarks, either related to the collection library and not

Contributing, Feedback & Support

I would like to accept feedback from you.

  • What method names/signatures are inconvenient?
  • Missing features
  • Performance experience
  • Bugs or problems

Use issues or ask a question in OpenHFT Google group.

How to build and develop

Gradle build requires Java 8 compiler, set JAVA_HOME environment variable to the JDK8 location, if your default java is still Java 7.

Then

$ git clone [email protected]:OpenHFT/Koloboke.git
$ cd Koloboke
$ ./gradlew :buildMeta
$ ./gradlew buildMain -x test -x findbugsMain
$ ./gradlew idea

Then you can open the project in IntelliJ IDEA.

To rebuild meta projects (code generators), run from the project root dir:

$ ./gradlew :cleanMeta :buildMeta

To rebuild either the lib, benchmarks or both, run

$ ./gradlew cleanMain buildMain

from the lib, benchmarks subdir or the root project dir respectively.

To build the lib for Java 8, run

$ ../gradlew cleanMain buildMain -PlibTargetJava=8

from the lib subdir.

If you want to generate proper Javadocs, especially for Java 6 or 7, you should specify javadocExecutable and jdkSrc build properties (see Gradle docs for how to do that). Typical javadocExecutable value is JAVA_HOME/bin/javadoc[.exe], jdkSrc should point to a directory which contain uncompressed JDK sources, i. e. package structure starting from java, javax, sun, etc. subdirs.


Project name history

  • Trove (This project was started as a Trove fork, but has nothing in common with Trove for already very long time.)
  • UntitledCollectionsProject, UCP
  • Higher Frequency Trading Collections, OpenHFT Collections, HFT Collections, HFTC
  • Koloboke (Collections) -- current name!

koloboke's People

Contributors

leventov avatar brentdouglas avatar peter-lawrey avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.