Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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:
one year ago
Benchmark engine:
Benchmark.js
Sync
16/s
Promise
14/s
View exact numbers
Test name
Executions per second
✓
Sync
16 Ops/sec
Promise
14 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();