baconjs/bacon.js — pull request #469 by lautis (2014-11-15 10:51:09+00:00)
Title: Remove stream laziness

Based on discussed in #465, remove laziness from stream evaluation. The performance didn't change drastically. Sampling is slower, but simple things such as map and scan are faster. However, at least for map, similar performance boost could be achieved by [removing instanceof checks from event classes](https://github.com/lautis/bacon.js/tree/instanceofless).

After

```
diamond x 185 ops/sec ±2.51% (89 runs sampled)
combo x 211 ops/sec ±3.50% (87 runs sampled)
zip x 3,864 ops/sec ±1.28% (97 runs sampled)
flatMap x 315 ops/sec ±4.02% (80 runs sampled)
Bacon.combineTemplate.sample x 514 ops/sec ±0.84% (92 runs sampled)
Bacon.combineTemplate (deep) x 41.47 ops/sec ±0.65% (56 runs sampled)
Bacon.combineTemplate x 553 ops/sec ±1.06% (97 runs sampled)
EventStream.map x 8,997 ops/sec ±0.65% (96 runs sampled)
EventStream.scan x 7,703 ops/sec ±1.59% (94 runs sampled)
EventStream.toProperty x 7,569 ops/sec ±0.73% (96 runs sampled)
```

Before

```
diamond x 180 ops/sec ±3.87% (88 runs sampled)
combo x 211 ops/sec ±3.24% (86 runs sampled)
zip x 3,285 ops/sec ±2.94% (89 runs sampled)
flatMap x 300 ops/sec ±3.59% (76 runs sampled)
Bacon.combineTemplate.sample x 678 ops/sec ±1.58% (95 runs sampled)
Bacon.combineTemplate (deep) x 33.74 ops/sec ±2.42% (61 runs sampled)
Bacon.combineTemplate x 440 ops/sec ±2.46% (92 runs sampled)
EventStream.map x 7,196 ops/sec ±0.74% (89 runs sampled)
EventStream.scan x 5,861 ops/sec ±1.45% (95 runs sampled)
EventStream.toProperty x 6,201 ops/sec ±0.60% (98 runs sampled)
```