Skip to content

Commit

Permalink
test(takeUntil): add micro-benchmark performance test for takeUntil o…
Browse files Browse the repository at this point in the history
…perator
  • Loading branch information
kwonoj authored and benlesh committed Oct 6, 2015
1 parent ec7ff1c commit 8daddde
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions perf/micro/immediate-scheduler/operators/skipuntil.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ module.exports = function (suite) {
function _error(e) { }
function _complete() { }
return suite
.add('old skip with immediate scheduler', function () {
.add('old skipUntil with immediate scheduler', function () {
oldSkipUntilWithImmediateScheduler.subscribe(_next, _error, _complete);
})
.add('new skip with immediate scheduler', function () {
.add('new skipUntil with immediate scheduler', function () {
newSkipUntilWithImmediateScheduler.subscribe(_next, _error, _complete);
});
};
};
20 changes: 20 additions & 0 deletions perf/micro/immediate-scheduler/operators/takeuntil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var RxOld = require('rx');
var RxNew = require('../../../../index');

module.exports = function (suite) {
var oldTakeUntilWithImmediateScheduler = RxOld.Observable.interval(25, RxOld.Scheduler.immediate)
.take(3).takeUntil(RxOld.Observable.timer(60, RxOld.Scheduler.immediate));
var newTakeUntilWithImmediateScheduler = RxNew.Observable.interval(25)
.take(3).takeUntil(RxNew.Observable.timer(60));

function _next(x) { }
function _error(e) { }
function _complete() { }
return suite
.add('old takeUntil with immediate scheduler', function () {
oldTakeUntilWithImmediateScheduler.subscribe(_next, _error, _complete);
})
.add('new takeUntil with immediate scheduler', function () {
newTakeUntilWithImmediateScheduler.subscribe(_next, _error, _complete);
});
};

0 comments on commit 8daddde

Please sign in to comment.