Judy Arrays Implemented in Node.js
C JavaScript C++ Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bench
src
test
.gitignore
.travis.yml
LICENSE
README.md node-judy 1.0.3-beta.0 Mar 6, 2016
binding.gyp
index.js
package.json node-judy 1.0.3-beta.0 Mar 6, 2016

README.md

Judy Arrays for Node.js

Build Status

Judy Arrays allow for fast and memory efficient access to in-memory hash tables.
Instantiation is slow, but continued use shows speed increases over native v8::Array implementation.
Some code cleanup was done to allow for clean compilation with g++ or clang++.

For more information, see Faster (sometimes) Associative Arrays with Node.js.

This specific Judy implementation is based on work by Karl Malbrain released via the New BSD license. The original work is available Here.

In a nutshell

  • Implements Judy Arrays via C++
  • Adds set/get/delete functionality

Building

node-gyp configure build

Testing and Benchmarking

There are a couple of tests, as well as a couple of benchmarks to compare against native associative arrays.

Testing:

node tests/big.js
node tests/multiple.js

Benchmarking:

node bench/native.js
node bench/judy.js

node bench/native.js --count=2000
node bench/judy.js --count=2000

Synopsis

Usage:

var judy   = require('judy');

var arr = new judy.Judy();
arr.set("some key", "some value");

var value = arr.get("some key");

arr.delete("some key");