codemix/fast.js — pull request #60 by phpnode (2014-09-27 21:28:06+00:00)
Title: Add support for String Interning

Makes string comparison very fast but is a relatively expensive operation itself, use judiciously, see http://en.wikipedia.org/wiki/String_interning

Method courtesy of @petkaantonov - http://jsperf.com/istrn/11

Benchmark results are pretty crazy for long strings:
```
Running 3 benchmarks, please wait...

Native string comparison vs fast.intern() (short)
✓ Native comparison x 34,012,224 ops/sec ±1.64% (89 runs sampled)
✓ fast.intern() x 91,459,408 ops/sec ±1.52% (84 runs sampled)

Result: fast.js is 168.90% faster than Native comparison.

Native string comparison vs fast.intern() (medium)
✓ Native comparison x 5,668,909 ops/sec ±1.26% (89 runs sampled)
✓ fast.intern() x 95,791,443 ops/sec ±1.42% (92 runs sampled)

Result: fast.js is 1589.77% faster than Native comparison.

Native string comparison vs fast.intern() (long)
✓ Native comparison x 72,747 ops/sec ±1.28% (84 runs sampled)
✓ fast.intern() x 91,542,789 ops/sec ±1.27% (82 runs sampled)

Result: fast.js is 125737.10% faster than Native comparison.

```