Skip to content

Commit

Permalink
perf: update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
staltz committed Dec 21, 2016
1 parent 9390c03 commit b12065d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 23 deletions.
3 changes: 1 addition & 2 deletions perf/combine.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var rxjs = require('@reactivex/rxjs')
var kefir = require('kefir');
var bacon = require('baconjs');
var lodash = require('lodash');
var highland = require('highland');

var runners = require('./runners');
var kefirFromArray = runners.kefirFromArray;
Expand Down Expand Up @@ -58,7 +57,7 @@ suite
.add('rx 5', function(deferred) {
runners.runRx5(deferred,
rxjs.Observable.combineLatest(rx1, rx2, rx3, add3).filter(even));
}, options);
}, options)

runners.runSuite(suite);

Expand Down
2 changes: 1 addition & 1 deletion perf/dataflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ suite
var label = bacon.fromArray(['initial', 'Count is ']);
var view = bacon.combineWith(renderWithArgs, label, count);
runners.runBacon(deferred, view);
}, options);
}, options)

runners.runSuite(suite);

Expand Down
2 changes: 1 addition & 1 deletion perf/filter-map-fusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ suite
})
.add('Array', function() {
return a.map(add1).filter(odd).map(add1).map(add1).filter(even).reduce(sum, 0);
});
})

runners.runSuite(suite);

Expand Down
2 changes: 1 addition & 1 deletion perf/filter-map-reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ suite
})
.add('Array', function() {
return a.filter(even).map(add1).reduce(sum, 0);
});
})

runners.runSuite(suite);

Expand Down
2 changes: 1 addition & 1 deletion perf/switchMap.js → perf/flatten.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ suite
}, options)
.add('bacon', function(deferred) {
runners.runBacon(deferred, bacon.fromArray(a).flatMapLatest(bacon.fromArray).reduce(0, sum));
}, options);
}, options)

runners.runSuite(suite);

Expand Down
5 changes: 3 additions & 2 deletions perf/flatMap.js → perf/flattenConcurrently.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var kefir = require('kefir');
var bacon = require('baconjs');
var lodash = require('lodash');
var highland = require('highland');
var flattenConcurrently = require('../extra/flattenConcurrently').default;

var runners = require('./runners');
var kefirFromArray = runners.kefirFromArray;
Expand Down Expand Up @@ -45,7 +46,7 @@ var options = {
suite
.add('xstream', function(deferred) {
runners.runXStream(deferred,
xs.fromArray(a).map(xs.fromArray).flattenConcurrently().fold(sum, 0).last());
xs.fromArray(a).map(xs.fromArray).compose(flattenConcurrently).fold(sum, 0).last());
}, options)
.add('most', function(deferred) {
runners.runMost(deferred, most.from(a).flatMap(most.from).reduce(sum, 0));
Expand All @@ -72,7 +73,7 @@ suite
})
.add('Array', function() {
return arrayFlatMap(identity, a).reduce(sum, 0);
});
})

runners.runSuite(suite);

Expand Down
2 changes: 1 addition & 1 deletion perf/scan.js → perf/fold.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ suite
})
.add('Array', function() {
return arrayScan(sum, 0, a).reduce(passthrough, 0);
});
})

runners.runSuite(suite);

Expand Down
2 changes: 1 addition & 1 deletion perf/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ suite
.add('Array', function() {
// "Merge" synchronous arrays by concatenation
return Array.prototype.concat.apply([], a).reduce(sum, 0);
});
})

runners.runSuite(suite);

Expand Down
31 changes: 18 additions & 13 deletions perf/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
{
"name": "xstream-perf",
"version": "0.0.0",
"description": "Perf tests for most.js",
"description": "Perf tests for xstream",
"author": "Andre Staltz <andre+npm@staltz.com> (http://andre.staltz.com/)",
"license": "MIT",
"scripts": {
"filter-map-fusion": "node ./filter-map-fusion",
"filter-map-reduce": "node ./filter-map-reduce",
"flatMap": "node ./flatMap.js",
"merge": "node ./merge.js",
"scan": "node ./scan.js",
"switchMap": "node ./switchMap",
"start": "npm run filter-map-reduce && npm run filter-map-fusion && npm run flatMap && npm run merge && npm run scan && npm run switchMap"
"flattenConcurrently": "node ./flattenConcurrently",
"merge": "node ./merge",
"combine": "node ./combine",
"fold": "node ./fold",
"flatten": "node ./flatten",
"dataflow": "node ./dataflow",
"start": "npm-run-all filter-map-reduce merge combine flatten fold dataflow flattenConcurrently filter-map-fusion"
},
"dependencies": {
"@reactivex/rxjs": "^5.0.0-beta.11",
"baconjs": "^0.7.85",
"@reactivex/rxjs": "5.0.x",
"baconjs": "0.7.x",
"benchmark": "github:bestiejs/benchmark.js#master",
"highland": "^2.9.0",
"kefir": "^3.4.0",
"lodash": "^4.15.0",
"most": "^1.0.1",
"rx": "^4.1.0"
"kefir": "3.6.x",
"lodash": "4.17.x",
"highland": "2.10.x",
"most": "1.1.x",
"rx": "4.1.x"
},
"devDependencies": {
"npm-run-all": "^3.1.2"
}
}

0 comments on commit b12065d

Please sign in to comment.