Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Rxjs-Filter vs JS-If
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Filter
98475.6 Ops/sec
If
107094.7 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.1/rxjs.umd.min.js'></script>
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
Filter
const stream = new rxjs.Subject(); stream.pipe( rxjs.operators.filter(v => v) ).subscribe(v => { console.log(v); }); stream.next(true); stream.next(false); stream.next(true);
If
const stream = new rxjs.Subject(); stream.subscribe(v => { if(v) { console.log(v); } }); stream.next(true); stream.next(false); stream.next(true);