codemix/fast.js — pull request #30 by phpnode (2014-06-27 20:52:53+00:00)
Title: split bindInteral() into two functions

it avoids a switch statement which seems to pay off on small inputs,

```
Running 9 benchmarks, please wait...

Native .map() vs fast.map() (3 items)
✓ Array::map() x 2,338,240 ops/sec ±1.95% (79 runs sampled)
✓ fast.map() x 17,274,552 ops/sec ±1.14% (90 runs sampled)
✓ fast.map() v0.0.1 x 14,958,102 ops/sec ±1.06% (88 runs sampled)
✓ fast.map() v0.0.0 x 13,813,671 ops/sec ±1.32% (88 runs sampled)
✓ underscore.map() x 2,104,565 ops/sec ±1.37% (87 runs sampled)
✓ lodash.map() x 9,546,646 ops/sec ±1.37% (88 runs sampled)

Winner is: fast.map() (720.81% faster)

Native .map() vs fast.map() (10 items)
✓ Array::map() x 1,449,173 ops/sec ±1.75% (82 runs sampled)
✓ fast.map() x 7,912,164 ops/sec ±1.46% (91 runs sampled)
✓ fast.map() v0.0.1 x 7,538,287 ops/sec ±1.33% (89 runs sampled)
✓ fast.map() v0.0.0 x 5,401,094 ops/sec ±1.50% (89 runs sampled)
✓ underscore.map() x 1,346,693 ops/sec ±1.63% (82 runs sampled)
✓ lodash.map() x 5,155,617 ops/sec ±1.54% (87 runs sampled)

Winner is: fast.map() (487.53% faster)

Native .map() vs fast.map() (1000 items)
✓ Array::map() x 31,104 ops/sec ±1.59% (89 runs sampled)
✓ fast.map() x 97,210 ops/sec ±1.24% (91 runs sampled)
✓ fast.map() v0.0.1 x 97,079 ops/sec ±1.42% (88 runs sampled)
✓ fast.map() v0.0.0 x 65,257 ops/sec ±1.72% (82 runs sampled)
✓ underscore.map() x 32,496 ops/sec ±1.68% (87 runs sampled)
✓ lodash.map() x 76,157 ops/sec ±1.43% (91 runs sampled)

Winner is: fast.map(),fast.map() v0.0.1 (212.53% faster)

Native .reduce() vs fast.reduce() (3 items)
✓ Array::reduce() x 6,623,982 ops/sec ±1.43% (92 runs sampled)
✓ fast.reduce() x 19,990,431 ops/sec ±1.68% (80 runs sampled)
✓ fast.reduce() v0.0.1 x 16,641,799 ops/sec ±1.15% (91 runs sampled)
✓ fast.reduce() v0.0.0 x 15,245,570 ops/sec ±0.98% (91 runs sampled)
✓ underscore.reduce() x 4,591,643 ops/sec ±1.35% (88 runs sampled)
✓ lodash.reduce() x 7,524,094 ops/sec ±1.20% (85 runs sampled)

Winner is: fast.reduce() (335.37% faster)

Native .reduce() vs fast.reduce() (10 items)
✓ Array::reduce() x 2,680,735 ops/sec ±0.93% (92 runs sampled)
✓ fast.reduce() x 8,800,087 ops/sec ±0.99% (84 runs sampled)
✓ fast.reduce() v0.0.1 x 8,248,990 ops/sec ±1.23% (89 runs sampled)
✓ fast.reduce() v0.0.0 x 5,620,043 ops/sec ±1.24% (90 runs sampled)
✓ underscore.reduce() x 2,304,515 ops/sec ±1.55% (90 runs sampled)
✓ lodash.reduce() x 4,388,768 ops/sec ±1.32% (88 runs sampled)

Winner is: fast.reduce() (281.86% faster)

Native .reduce() vs fast.reduce() (1000 items)
✓ Array::reduce() x 35,376 ops/sec ±1.64% (89 runs sampled)
✓ fast.reduce() x 114,712 ops/sec ±1.51% (92 runs sampled)
✓ fast.reduce() v0.0.1 x 111,224 ops/sec ±1.67% (88 runs sampled)
✓ fast.reduce() v0.0.0 x 68,381 ops/sec ±1.68% (87 runs sampled)
✓ underscore.reduce() x 34,643 ops/sec ±0.95% (80 runs sampled)
✓ lodash.reduce() x 78,395 ops/sec ±1.43% (92 runs sampled)

Winner is: fast.reduce() (231.13% faster)

Native .forEach() vs fast.forEach() (3 items)
✓ Array::forEach() x 6,602,630 ops/sec ±1.01% (91 runs sampled)
✓ fast.forEach() x 18,928,816 ops/sec ±1.06% (92 runs sampled)
✓ fast.forEach() v0.0.1 x 16,789,617 ops/sec ±1.23% (88 runs sampled)
✓ fast.forEach() v0.0.0 x 14,388,969 ops/sec ±0.99% (93 runs sampled)
✓ underscore.forEach() x 5,856,117 ops/sec ±0.80% (89 runs sampled)
✓ lodash.forEach() x 18,188,271 ops/sec ±0.73% (86 runs sampled)

Winner is: fast.forEach() (223.23% faster)

Native .forEach() vs fast.forEach() (10 items)
✓ Array::forEach() x 2,621,967 ops/sec ±1.10% (89 runs sampled)
✓ fast.forEach() x 7,788,570 ops/sec ±0.97% (93 runs sampled)
✓ fast.forEach() v0.0.1 x 7,415,281 ops/sec ±1.13% (86 runs sampled)
✓ fast.forEach() v0.0.0 x 5,303,683 ops/sec ±1.00% (91 runs sampled)
✓ underscore.forEach() x 2,579,953 ops/sec ±1.04% (91 runs sampled)
✓ lodash.forEach() x 7,676,975 ops/sec ±1.03% (91 runs sampled)

Winner is: fast.forEach(),lodash.forEach() (201.89% faster)

Native .forEach() vs fast.forEach() (1000 items)
✓ Array::forEach() x 34,728 ops/sec ±1.06% (87 runs sampled)
✓ fast.forEach() x 94,461 ops/sec ±0.82% (93 runs sampled)
✓ fast.forEach() v0.0.1 x 94,805 ops/sec ±1.09% (89 runs sampled)
✓ fast.forEach() v0.0.0 x 67,280 ops/sec ±1.28% (86 runs sampled)
✓ underscore.forEach() x 34,626 ops/sec ±0.94% (89 runs sampled)
✓ lodash.forEach() x 95,518 ops/sec ±1.23% (90 runs sampled)

Winner is: lodash.forEach(),fast.forEach() v0.0.1 (175.85% faster)

Finished in 601 seconds

```