diff --git a/perf/micro/current-thread-scheduler/observable/throw.js b/perf/micro/current-thread-scheduler/observable/throw.js new file mode 100644 index 0000000000..30b9ef33e3 --- /dev/null +++ b/perf/micro/current-thread-scheduler/observable/throw.js @@ -0,0 +1,20 @@ +var RxOld = require("rx"); +var RxNew = require("../../../../index"); + +module.exports = function _throw(suite) { + + var oldThrowWithCurrentThreadScheduler = RxOld.Observable.throw(new Error('error'), RxOld.Scheduler.currentThread); + var newThrowWithCurrentThreadScheduler = RxNew.Observable.throw(new Error('error'), RxNew.Scheduler.immediate); + + // add tests + return suite + .add('old throw with current thread scheduler', function () { + oldThrowWithCurrentThreadScheduler.subscribe(_next, _error, _complete); + }) + .add('new throw with current thread scheduler', function () { + newThrowWithCurrentThreadScheduler.subscribe(_next, _error, _complete); + }); + function _next(x) { } + function _error(e){ } + function _complete(){ } +}; \ No newline at end of file diff --git a/perf/micro/immediate-scheduler/observable/throw.js b/perf/micro/immediate-scheduler/observable/throw.js new file mode 100644 index 0000000000..645f23e1c8 --- /dev/null +++ b/perf/micro/immediate-scheduler/observable/throw.js @@ -0,0 +1,20 @@ +var RxOld = require("rx"); +var RxNew = require("../../../../index"); + +module.exports = function _throw(suite) { + + var oldThrowWithImmediateScheduler = RxOld.Observable.throw(new Error('error'), RxOld.Scheduler.immediate); + var newThrowWithImmediateScheduler = RxNew.Observable.throw(new Error('error')); + + // add tests + return suite + .add('old throw with immediate scheduler', function () { + oldThrowWithImmediateScheduler.subscribe(_next, _error, _complete); + }) + .add('new throw with immediate scheduler', function () { + newThrowWithImmediateScheduler.subscribe(_next, _error, _complete); + }); + function _next(x) { } + function _error(e){ } + function _complete(){ } +}; \ No newline at end of file diff --git a/perf/micro/index.js b/perf/micro/index.js index b822db3165..dc5d885d84 100644 --- a/perf/micro/index.js +++ b/perf/micro/index.js @@ -11,6 +11,7 @@ Observable.from([ require("./immediate-scheduler/observable/from-with-string"), require("./immediate-scheduler/observable/of"), require("./immediate-scheduler/observable/range"), + require("./immediate-scheduler/observable/throw"), require("./immediate-scheduler/operators/combine-latest"), require("./immediate-scheduler/operators/concat"), @@ -40,6 +41,7 @@ Observable.from([ require("./current-thread-scheduler/observable/from-with-string"), require("./current-thread-scheduler/observable/of"), require("./current-thread-scheduler/observable/range"), + require("./current-thread-scheduler/observable/throw"), require("./current-thread-scheduler/operators/combine-latest"), require("./current-thread-scheduler/operators/concat"),