-
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.
chore(test): add micro-benchmark performance test for startwith operator
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
perf/micro/current-thread-scheduler/operators/start-with.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,20 @@ | ||
var RxOld = require("rx"); | ||
var RxNew = require("../../../../index"); | ||
|
||
module.exports = function (suite) { | ||
|
||
var oldStartWithWithCurrentThreadScheduler = RxOld.Observable.of(25, RxOld.Scheduler.currentThread).startWith(5, RxOld.Scheduler.currentThread); | ||
var newStartWithWithCurrentThreadScheduler = RxNew.Observable.of(25, RxNew.Scheduler.immediate).startWith(5, RxNew.Scheduler.immediate); | ||
|
||
return suite | ||
.add('old startWith with current thread scheduler', function () { | ||
oldStartWithWithCurrentThreadScheduler.subscribe(_next, _error, _complete); | ||
}) | ||
.add('new startWith with current thread scheduler', function () { | ||
newStartWithWithCurrentThreadScheduler.subscribe(_next, _error, _complete); | ||
}); | ||
|
||
function _next(x) { } | ||
function _error(e){ } | ||
function _complete(){ } | ||
}; |
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,20 @@ | ||
var RxOld = require("rx"); | ||
var RxNew = require("../../../../index"); | ||
|
||
module.exports = function (suite) { | ||
|
||
var oldStartWithWithImmediateScheduler = RxOld.Observable.of(25, RxOld.Scheduler.immediate).startWith(5, RxOld.Scheduler.immediate); | ||
var newStartWithWithImmediateScheduler = RxNew.Observable.of(25).startWith(5); | ||
|
||
return suite | ||
.add('old startWith with immediate scheduler', function () { | ||
oldStartWithWithImmediateScheduler.subscribe(_next, _error, _complete); | ||
}) | ||
.add('new startWith with immediate scheduler', function () { | ||
newStartWithWithImmediateScheduler.subscribe(_next, _error, _complete); | ||
}); | ||
|
||
function _next(x) { } | ||
function _error(e){ } | ||
function _complete(){ } | ||
}; |
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