Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Iterator.from vs array: filter+map
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/150.0.0.0 YaBrowser/26.8.0.0 Safari/537.36
Browser:
Yandex Browser 26
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 days ago
Benchmark engine:
Benchmark.js
Iterator.from WITHOUT collecting to array
14.5M/s
Array
1K/s
Iterator.from WITH collecting to array
478/s
View exact numbers
Test name
Executions per second
✓
Iterator.from WITHOUT collecting to array
14,450,101 Ops/sec
Array
1,130 Ops/sec
Iterator.from WITH collecting to array
478 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const items = Array(100_000).fill(0).map((_, i) => i);
Tests:
Array
const arrayTransform = items.filter(i => i % 2 === 0).map(n => n * 2);
Iterator.from WITH collecting to array
const iterTransformAsArray = Iterator.from(items).filter(i => i % 2 === 0).map(n => n * 2).toArray();
Iterator.from WITHOUT collecting to array
const iterTransformAsIterator = Iterator.from(items).filter(i => i % 2 === 0).map(n => n * 2);