Code Monkey home page Code Monkey logo

btreemap's Introduction

btreemap

This is a simple and high-performance Java B-tree that is intended to be used as a drop-in replacement for java.util.TreeMap in situations where the vanilla binary trees used by the JDK are just too slow.

For maps with 100k keys, performance is like this on my machine:

Benchmark                   Mode  Cnt        Score        Error  Units
BTreeMapBenchmark.get       thrpt   20  5500161.400 ±  70850.009  ops/s
BTreeMapBenchmark.lowerKey  thrpt   20  4720565.667 ± 259185.836  ops/s
BTreeMapBenchmark.put       thrpt   20  3757808.623 ±  37792.128  ops/s

With TreeMap the numbers are about 50%-60% worse:

Benchmark                   Mode  Cnt        Score       Error  Units
BTreeMapBenchmark.get       thrpt   20  3404585.749 ± 47180.578  ops/s
BTreeMapBenchmark.lowerKey  thrpt   20  3255788.782 ± 54390.949  ops/s
BTreeMapBenchmark.put       thrpt   20  2542375.846 ± 38924.217  ops/s

The source code lives at GitHub. If you just want some JARs, check out Maven Central.

Build Status

btreemap's People

Contributors

batterseapower avatar

Watchers

 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.