baconjs/bacon.js — pull request #463 by raimohanska (2014-11-11 22:58:25+00:00)
Title: Eliminate extra dispatcher in `withHandler`

Accidentally discovered this stupidity (authored by yours truly). Surely we want to get rid of this overhead?

Perf results before:

diamond x 48.72 ops/sec ±7.21% (40 runs sampled)
combo x 63.66 ops/sec ±7.04% (46 runs sampled)
zip x 1,730 ops/sec ±5.27% (80 runs sampled)
flatMap x 161 ops/sec ±5.87% (71 runs sampled)
Bacon.combineTemplate.sample x 351 ops/sec ±4.83% (78 runs sampled)
Bacon.combineTemplate (deep) x 19.92 ops/sec ±3.98% (38 runs sampled)
Bacon.combineTemplate x 243 ops/sec ±3.31% (75 runs sampled)
EventStream.map x 4,130 ops/sec ±5.85% (83 runs sampled)
EventStream.scan x 3,360 ops/sec ±5.19% (84 runs sampled)
EventStream.toProperty x 3,479 ops/sec ±5.25% (87 runs sampled)

After:

diamond x 57.63 ops/sec ±7.41% (53 runs sampled)
combo x 64.96 ops/sec ±6.87% (45 runs sampled)
zip x 1,765 ops/sec ±7.08% (79 runs sampled)
flatMap x 170 ops/sec ±5.04% (73 runs sampled)
Bacon.combineTemplate.sample x 337 ops/sec ±4.60% (71 runs sampled)
Bacon.combineTemplate (deep) x 18.96 ops/sec ±3.66% (36 runs sampled)
Bacon.combineTemplate x 240 ops/sec ±2.78% (79 runs sampled)
EventStream.map x 4,644 ops/sec ±4.75% (76 runs sampled)
EventStream.scan x 3,193 ops/sec ±4.54% (82 runs sampled)
EventStream.toProperty x 3,413 ops/sec ±4.49% (84 runs sampled)

I'd say the difference in `map` shows the gain while the other diffs are coincidental.