codemix/fast.js — pull request #35 by phpnode (2014-06-28 11:12:11+00:00)
Title: Prepare 0.0.2

Adds latest V8 benchmarks to README, Spidermonkey benchmarks follow:

```

Running 25 benchmarks, please wait...

fast.try() vs try {} catch (e) {}
✓ try...catch x 86,015 ops/sec ±1.36% (62 runs sampled)
✓ fast.try() x 5,139,322 ops/sec ±0.18% (69 runs sampled)

Winner is: fast.try() (5874.92% faster)

fast.clone() vs underscore.clone() vs lodash.clone()
✓ fast.clone() x 609,869 ops/sec ±0.25% (68 runs sampled)
✓ underscore.clone() x 481,962 ops/sec ±1.33% (67 runs sampled)
✓ lodash.clone() x 431,468 ops/sec ±1.55% (67 runs sampled)

Winner is: fast.clone() (41.35% faster)

Native .indexOf() vs fast.indexOf() (3 items)
✓ Array::indexOf() x 25,644,670 ops/sec ±0.40% (67 runs sampled)
✓ fast.indexOf() x 95,508,056 ops/sec ±0.46% (67 runs sampled)
✓ underscore.indexOf() x 501,811 ops/sec ±0.20% (39 runs sampled)
✓ lodash.indexOf() x 41,111,118 ops/sec ±0.38% (65 runs sampled)

Winner is: fast.indexOf() (18932.69% faster)

Native .indexOf() vs fast.indexOf() (10 items)
✓ Array::indexOf() x 18,910,147 ops/sec ±0.34% (69 runs sampled)
✓ fast.indexOf() x 52,072,684 ops/sec ±0.33% (69 runs sampled)
✓ underscore.indexOf() x 456,818 ops/sec ±0.23% (67 runs sampled)
✓ lodash.indexOf() x 30,165,542 ops/sec ±0.37% (66 runs sampled)

Winner is: fast.indexOf() (11299.00% faster)

Native .indexOf() vs fast.indexOf() (1000 items)
✓ Array::indexOf() x 428,747 ops/sec ±0.17% (63 runs sampled)
✓ fast.indexOf() x 890,381 ops/sec ±0.19% (69 runs sampled)
✓ underscore.indexOf() x 35,428 ops/sec ±0.16% (70 runs sampled)
✓ lodash.indexOf() x 942,665 ops/sec ±0.19% (69 runs sampled)

Winner is: lodash.indexOf() (2560.76% faster)

Native .lastIndexOf() vs fast.lastIndexOf() (3 items)
✓ Array::lastIndexOf() x 60,534,812 ops/sec ±0.28% (69 runs sampled)
✓ fast.lastIndexOf() x 529,913,781 ops/sec ±0.84% (68 runs sampled)
✓ underscore.lastIndexOf() x 37,432,623 ops/sec ±0.29% (68 runs sampled)
✓ lodash.lastIndexOf() x 77,642,290 ops/sec ±0.38% (70 runs sampled)

Winner is: fast.lastIndexOf() (1315.65% faster)

Native .lastIndexOf() vs fast.lastIndexOf() (10 items)
✓ Array::lastIndexOf() x 31,081,822 ops/sec ±0.23% (70 runs sampled)
✓ fast.lastIndexOf() x 119,827,519 ops/sec ±1.30% (64 runs sampled)
✓ underscore.lastIndexOf() x 18,903,601 ops/sec ±0.20% (69 runs sampled)
✓ lodash.lastIndexOf() x 35,717,525 ops/sec ±0.44% (42 runs sampled)

Winner is: fast.lastIndexOf() (533.89% faster)

Native .lastIndexOf() vs fast.lastIndexOf() (1000 items)
✓ Array::lastIndexOf() x 2,310,528 ops/sec ±0.21% (69 runs sampled)
✓ fast.lastIndexOf() x 2,384,146 ops/sec ±1.32% (68 runs sampled)
✓ underscore.lastIndexOf() x 2,202,596 ops/sec ±0.18% (69 runs sampled)
✓ lodash.lastIndexOf() x 1,365,665 ops/sec ±0.40% (69 runs sampled)

Winner is: fast.lastIndexOf() (74.58% faster)

Native .bind() vs fast.bind()
✓ Function::bind() x 1,210,041 ops/sec ±2.36% (53 runs sampled)
✓ fast.bind() x 1,820,833 ops/sec ±2.33% (62 runs sampled)
✓ underscore.bind() x 557,947 ops/sec ±3.07% (59 runs sampled)
✓ lodash.bind() x 278,102 ops/sec ±1.90% (61 runs sampled)

Winner is: fast.bind() (554.74% faster)

Native .bind() vs fast.bind() with prebound functions
✓ Function::bind() x 127,213,888 ops/sec ±0.36% (69 runs sampled)
✓ fast.bind() x 5,023,286 ops/sec ±0.20% (70 runs sampled)
✓ underscore.bind() x 126,229,672 ops/sec ±0.20% (69 runs sampled)
✓ lodash.bind() x 1,800,809 ops/sec ±2.21% (65 runs sampled)

Winner is: Function::bind() (6964.26% faster)

Native .bind() vs fast.partial()
✓ Function::bind() x 1,212,495 ops/sec ±1.87% (52 runs sampled)
✓ fast.partial() x 1,804,761 ops/sec ±2.39% (61 runs sampled)
✓ fast.partial() v0.0.0 x 984,434 ops/sec ±2.08% (63 runs sampled)
✓ underscore.partial() x 905,742 ops/sec ±1.79% (63 runs sampled)
✓ lodash.partial() x 285,272 ops/sec ±2.01% (62 runs sampled)

Winner is: fast.partial() (532.64% faster)

Native .bind() vs fast.partial() with prebound functions
✓ Function::bind() x 134,584,347 ops/sec ±0.42% (68 runs sampled)
✓ fast.partial() x 5,040,780 ops/sec ±0.56% (68 runs sampled)
✓ fast.partial() v0.0.0 x 4,638,434 ops/sec ±0.17% (69 runs sampled)
✓ underscore.partial() x 3,324,625 ops/sec ±0.27% (69 runs sampled)
✓ lodash.partial() x 1,780,268 ops/sec ±2.38% (65 runs sampled)

Winner is: Function::bind() (7459.78% faster)

Native .map() vs fast.map() (3 items)
✓ Array::map() x 10,888,716 ops/sec ±0.27% (68 runs sampled)
✓ fast.map() x 12,851,637 ops/sec ±0.21% (69 runs sampled)
✓ fast.map() v0.0.2a x 2,385,730 ops/sec ±2.84% (61 runs sampled)
✓ fast.map() v0.0.1 x 2,454,317 ops/sec ±2.94% (60 runs sampled)
✓ fast.map() v0.0.0 x 11,031,164 ops/sec ±0.30% (69 runs sampled)
✓ underscore.map() x 7,799,572 ops/sec ±0.35% (69 runs sampled)
✓ lodash.map() x 5,755,212 ops/sec ±0.19% (69 runs sampled)

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

Native .map() vs fast.map() (10 items)
✓ Array::map() x 5,631,587 ops/sec ±0.28% (69 runs sampled)
✓ fast.map() x 6,605,991 ops/sec ±0.27% (69 runs sampled)
✓ fast.map() v0.0.2a x 1,615,367 ops/sec ±2.01% (66 runs sampled)
✓ fast.map() v0.0.1 x 1,628,356 ops/sec ±2.09% (65 runs sampled)
✓ fast.map() v0.0.0 x 6,701,650 ops/sec ±0.24% (61 runs sampled)
✓ underscore.map() x 4,793,393 ops/sec ±0.22% (70 runs sampled)
✓ lodash.map() x 3,580,290 ops/sec ±0.21% (69 runs sampled)

Winner is: fast.map() v0.0.0 (314.87% faster)

Native .map() vs fast.map() (1000 items)
✓ Array::map() x 69,645 ops/sec ±1.60% (63 runs sampled)
✓ fast.map() x 83,680 ops/sec ±1.10% (54 runs sampled)
✓ fast.map() v0.0.2a x 28,977 ops/sec ±1.50% (64 runs sampled)
✓ fast.map() v0.0.1 x 29,236 ops/sec ±1.78% (62 runs sampled)
✓ fast.map() v0.0.0 x 82,401 ops/sec ±1.15% (60 runs sampled)
✓ underscore.map() x 67,855 ops/sec ±1.72% (62 runs sampled)
✓ lodash.map() x 56,049 ops/sec ±1.09% (60 runs sampled)

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

Native .reduce() vs fast.reduce() (3 items)
✓ Array::reduce() x 59,484,401 ops/sec ±0.38% (58 runs sampled)
✓ fast.reduce() x 78,823,112 ops/sec ±0.23% (69 runs sampled)
✓ fast.reduce() v0.0.2c x 2,440,256 ops/sec ±2.50% (59 runs sampled)
✓ fast.reduce() v0.0.2b x 75,760,697 ops/sec ±0.16% (70 runs sampled)
✓ fast.reduce() v0.0.2a x 3,019,483 ops/sec ±3.19% (55 runs sampled)
✓ fast.reduce() v0.0.1 x 2,954,158 ops/sec ±3.09% (54 runs sampled)
✓ fast.reduce() v0.0.0 x 29,075,361 ops/sec ±0.31% (65 runs sampled)
✓ underscore.reduce() x 1,377,369 ops/sec ±2.68% (60 runs sampled)
✓ lodash.reduce() x 1,169,051 ops/sec ±2.35% (59 runs sampled)

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

Native .reduce() vs fast.reduce() (10 items)
✓ Array::reduce() x 11,536,507 ops/sec ±0.42% (67 runs sampled)
✓ fast.reduce() x 11,764,810 ops/sec ±0.19% (69 runs sampled)
✓ fast.reduce() v0.0.2c x 1,572,494 ops/sec ±1.99% (65 runs sampled)
✓ fast.reduce() v0.0.2b x 11,647,009 ops/sec ±0.16% (70 runs sampled)
✓ fast.reduce() v0.0.2a x 2,058,742 ops/sec ±2.67% (62 runs sampled)
✓ fast.reduce() v0.0.1 x 2,048,831 ops/sec ±2.64% (62 runs sampled)
✓ fast.reduce() v0.0.0 x 11,830,950 ops/sec ±0.21% (70 runs sampled)
✓ underscore.reduce() x 1,237,913 ops/sec ±2.09% (62 runs sampled)
✓ lodash.reduce() x 913,996 ops/sec ±1.80% (62 runs sampled)

Winner is: fast.reduce() v0.0.0 (1194.42% faster)

Native .reduce() vs fast.reduce() (1000 items)
✓ Array::reduce() x 126,053 ops/sec ±0.21% (69 runs sampled)
✓ fast.reduce() x 130,232 ops/sec ±0.18% (69 runs sampled)
✓ fast.reduce() v0.0.2c x 31,810 ops/sec ±0.34% (69 runs sampled)
✓ fast.reduce() v0.0.2b x 131,169 ops/sec ±0.18% (70 runs sampled)
✓ fast.reduce() v0.0.2a x 41,401 ops/sec ±0.18% (69 runs sampled)
✓ fast.reduce() v0.0.1 x 42,182 ops/sec ±0.40% (69 runs sampled)
✓ fast.reduce() v0.0.0 x 130,896 ops/sec ±0.16% (70 runs sampled)
✓ underscore.reduce() x 112,984 ops/sec ±0.67% (66 runs sampled)
✓ lodash.reduce() x 32,849 ops/sec ±0.28% (69 runs sampled)

Winner is: fast.reduce() v0.0.2b,fast.reduce() v0.0.0,fast.reduce() (312.35% faster)

Native .forEach() vs fast.forEach() (3 items)
✓ Array::forEach() x 12,979,438 ops/sec ±0.29% (69 runs sampled)
✓ fast.forEach() x 55,837,109 ops/sec ±0.19% (69 runs sampled)
✓ fast.forEach() v0.0.2a x 3,082,876 ops/sec ±3.48% (55 runs sampled)
✓ fast.forEach() v0.0.1 x 3,118,799 ops/sec ±3.46% (55 runs sampled)
✓ fast.forEach() v0.0.0 x 34,164,488 ops/sec ±0.44% (67 runs sampled)
✓ underscore.forEach() x 10,827,511 ops/sec ±0.29% (70 runs sampled)
✓ lodash.forEach() x 30,524,394 ops/sec ±0.32% (68 runs sampled)

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

Native .forEach() vs fast.forEach() (10 items)
✓ Array::forEach() x 4,041,193 ops/sec ±0.17% (69 runs sampled)
✓ fast.forEach() x 12,951,885 ops/sec ±0.22% (68 runs sampled)
✓ fast.forEach() v0.0.2a x 2,146,622 ops/sec ±2.68% (62 runs sampled)
✓ fast.forEach() v0.0.1 x 2,092,337 ops/sec ±2.63% (61 runs sampled)
✓ fast.forEach() v0.0.0 x 12,121,926 ops/sec ±0.39% (68 runs sampled)
✓ underscore.forEach() x 3,769,985 ops/sec ±0.28% (68 runs sampled)
✓ lodash.forEach() x 12,569,484 ops/sec ±0.22% (70 runs sampled)

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

Native .forEach() vs fast.forEach() (1000 items)
✓ Array::forEach() x 43,916 ops/sec ±0.23% (69 runs sampled)
✓ fast.forEach() x 143,920 ops/sec ±0.20% (68 runs sampled)
✓ fast.forEach() v0.0.2a x 41,929 ops/sec ±0.40% (70 runs sampled)
✓ fast.forEach() v0.0.1 x 39,886 ops/sec ±0.20% (69 runs sampled)
✓ fast.forEach() v0.0.0 x 131,757 ops/sec ±0.25% (67 runs sampled)
✓ underscore.forEach() x 44,490 ops/sec ±0.29% (69 runs sampled)
✓ lodash.forEach() x 151,610 ops/sec ±0.21% (66 runs sampled)

Winner is: lodash.forEach() (280.11% faster)

Native .concat() vs fast.concat() (3 items)
✓ Array::concat() x 3,782,638 ops/sec ±0.95% (37 runs sampled)
✓ fast.concat() x 1,947,193 ops/sec ±3.12% (61 runs sampled)

Winner is: Array::concat() (94.26% faster)

Native .concat() vs fast.concat() (10 items)
✓ Array::concat() x 2,585,287 ops/sec ±0.29% (70 runs sampled)
✓ fast.concat() x 1,487,464 ops/sec ±2.06% (63 runs sampled)

Winner is: Array::concat() (73.81% faster)

Native .concat() vs fast.concat() (1000 items)
✓ Array::concat() x 45,325 ops/sec ±0.52% (64 runs sampled)
✓ fast.concat() x 85,230 ops/sec ±0.57% (55 runs sampled)

Winner is: fast.concat() (88.04% faster)

Native .concat() vs fast.concat() (1000 items, using apply)
✓ Array::concat() x 39,119 ops/sec ±0.44% (65 runs sampled)
✓ fast.concat() x 12,846 ops/sec ±1.33% (61 runs sampled)

Winner is: Array::concat() (204.51% faster)

```