Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Sync vs Promise benchmark test
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36 OPR/89.0.0.0
Browser:
Opera Mobile 89
Operating system:
Android
Device Platform:
Mobile
Date tested:
10 months ago
Test name
Executions per second
Sync
15.5 Ops/sec
Promise
13.9 Ops/sec
Script Preparation code:
function foo() { const array = []; const count = 1000000; for (let i = 0; i < count; i++) { array.push(Math.random() * count); } return array.filter(num => num > count / 2); }
Tests:
Sync
const run = () => { const result = foo(); console.log(result); }; run();
Promise
const run = async () => { const promise = new Promise(resolve => { resolve(foo()); }); const result = await promise; console.log(result); } run();