Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Rxjs several pipes vs one 100k without functional array functions at all
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
RxJS one pipe
187929.0 Ops/sec
Several pipes
236975.6 Ops/sec
HTML Preparation code:
<script src='https://unpkg.com/rxjs@6.5.5/bundles/rxjs.umd.min.js'></script>
Script Preparation code:
var rawdata = Array.from(Array(100000).keys()) // 10k numbers 1,2,3,4,5...
Tests:
RxJS one pipe
let { from, Observable } = rxjs; let { flatMap, map, tap, toArray } = rxjs.operators; const data$ = from(rawdata) .pipe( map(values => { const finalValues = new Map(); values.forEach(value => { value = value * 2; if (value % 3 === 0) { finalValues.set(value.toString(), value) } }) return finalValues; }) ) let data; data$.subscribe(d => data = d);
Several pipes
let { from, Observable } = rxjs; let { flatMap, map, tap, toArray } = rxjs.operators; const data$ = from(rawdata) .pipe( map(values => values.map(value => value * 2)), map(values => values.filter(value => value % 3 === 0)), map(values => { const finalValues = new Map(); values.forEach(value => finalValues.set(value.toString(), value)); return finalValues; }) ) let data; data$.subscribe(d => data = d);