Coder Social home page Coder Social logo

high-scale-lib's Introduction

High Scale Lib

This is Boundary's fork of Cliff Click's high scale lib. We will be maintaining this fork with bug fixes, improvements and versioned builds in maven central.

To use high scale lib from ivy declare the dependency in ivy.xml:

<dependency
  org="com.boundary"
  name="high-scale-lib"
  rev="1.0.3" />

From maven simply add the dependency to the dependencies element:

<dependency>
  <groupId>com.boundary</groupId>
  <artifactId>high-scale-lib</artifactId>
  <version>1.0.6</version>
</dependency>

Original README

IF YOU ARE LOOKING for the drop-in replacement for java.util.Hashtable, it's in the lib directory, lib/java_util_hashtable.jar. It needs to be in your bootclasspath. Example:

java -Xbootclasspath/p:lib/java_util_hashtable.jar my_java_app_goes_here

A collection of Concurrent and Highly Scalable Utilities. These are intended as direct replacements for the java.util.* or java.util.concurrent.* collections but with better performance when many CPUs are using the collection concurrently. Single-threaded performance may be slightly lower.

The direct replacements match the API - but not all behaviors are covered by the API, and so they may not work for your program. In particular, the replacement for java.util.Hashtable is NOT synchronized (that is the point!), although it is multi-threaded safe. If you rely on the undocumented synchronization behavior of the JDK Hashtable, your program may not work. Similarly, the iteration order is different between this version and the JDK version (this exact issue broke the SpecJBB benchmark when the iteration order was changed slightly (via using a slightly different hash function) between JDK rev's).

If you want to drop-in the non-blocking versions of Hashtable, HashMap or ConcurrentHashMap, you'll need to alter your bootclasspath - these classes come directly from your JDK and so are found via the System loader before any class-path hacks can be done.

To replace the JDK implementation of Hashtable with a non-blocking version of Hashtable, add java_util_hashtable.jar to your java launch line:

java -Xbootclasspath/p:lib/java_util_hashtable.jar my_app_goes_here

Similarly for ConcurrentHashMap, add java_util_concurrent_chm.jar:

java -Xbootclasspath/p:lib/java_util_concurrent_chm.jar my_app_goes_here

The other utilities do not have direct JDK replacements; you need to call them out directly and place high_scale_lib.jar in your classpath:

  • NonBlockingHashMap - Fast, concurrent, lock-free HashMap. Linear scaling to 768 CPUs.
  • NonBlockingHashMapLong - Same as above, but using primitive 'long' keys
  • NonBlockingHashSet - A Set version of NBHM
  • NonBlockingSetInt - A fast fully concurrent BitVector
  • Counter - A simple counter that scales linearly even when extremely hot. Most simple counters are either unsynchronized (hence drop counts, generally really badly beyond 2 cpus), or are normally lock'd (hence bottleneck in the 5-10 cpu range), or might use Atomic's (hence bottleneck in the 25-50 cpu range). This version scales linearly to 768 CPUs.

Cliff Click

high-scale-lib's People

Contributors

boundaryjenkins avatar collinvandyck avatar d2fn avatar moonpolysoft avatar

Watchers

 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.