Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Judy Arrays Implemented in Node.js

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 benchmark
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.md
Octocat-spinner-32 binding.gyp
Octocat-spinner-32 judy.js
Octocat-spinner-32 package.json
README.md

Judy Arrays for Node.js

Judy Arrays allow for fast and memory efficient access to in-memory hash tables. This specific Judy implementation is based on work by Karl Malbrain released via the New BSD license. The original work is available Here. Some code cleanup was done to allow for clean compilation with g++.

Instantiation is slow, but continued use shows speed increases over native v8::Array implementation.

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

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:

cd tests
node big.js
node multiple.js

Benchmarking:

cd benchmark
node native.js
node judy.js

node native.js --count=2000
node 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");
Something went wrong with that request. Please try again.