-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(skip): add micro perf tests for skip over scalar
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var RxOld = require('rx'); | ||
var RxNew = require('../../../../index'); | ||
|
||
module.exports = function (suite) { | ||
var oldSkipWithImmediateScheduler = RxOld.Observable.just(50, RxOld.Scheduler.immediate).skip(0); | ||
var newSkipWithImmediateScheduler = RxNew.Observable.of(50).skip(0); | ||
|
||
function _next(x) { } | ||
function _error(e) { } | ||
function _complete() { } | ||
return suite | ||
.add('old skip with immediate scheduler', function () { | ||
oldSkipWithImmediateScheduler.subscribe(_next, _error, _complete); | ||
}) | ||
.add('new skip with immediate scheduler', function () { | ||
newSkipWithImmediateScheduler.subscribe(_next, _error, _complete); | ||
}); | ||
}; |
18 changes: 18 additions & 0 deletions
18
perf/micro/immediate-scheduler/operators/skip-scalar-outofbounds.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var RxOld = require('rx'); | ||
var RxNew = require('../../../../index'); | ||
|
||
module.exports = function (suite) { | ||
var oldSkipWithImmediateScheduler = RxOld.Observable.just(50, RxOld.Scheduler.immediate).skip(25); | ||
var newSkipWithImmediateScheduler = RxNew.Observable.of(50).skip(25); | ||
|
||
function _next(x) { } | ||
function _error(e) { } | ||
function _complete() { } | ||
return suite | ||
.add('old skip with immediate scheduler', function () { | ||
oldSkipWithImmediateScheduler.subscribe(_next, _error, _complete); | ||
}) | ||
.add('new skip with immediate scheduler', function () { | ||
newSkipWithImmediateScheduler.subscribe(_next, _error, _complete); | ||
}); | ||
}; |