txus/assoc.js — pull request #5 by x3ro (2012-06-26 22:08:06+00:00)
Title: Use a hash-table for value look-up

This PR implements the hash-table based lookup as discussed in #2. I also hacked a [little benchmark](https://gist.github.com/2999594) together, with these results (on Mac OS X with node v0.8.0, the benchmarks created 6,000,000+ elements):

##### No lookup table

#push performance x 1,080,656 ops/sec ±50.39% (16 runs sampled)
#assoc performance x 21.42 ops/sec ±6.68% (23 runs sampled)

##### With lookup table

#push performance x 247,906 ops/sec ±39.84% (22 runs sampled)
#assoc performance x 1,255,040 ops/sec ±0.82% (67 runs sampled)

I also generated a sample [pycco](https://github.com/fitzgen/pycco) generated ["documentation"](http://x3ro.github.com/assoc.js/), but I guess it isn't worth much before all methods are documented.