Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
async function w/microtask vs sync function (with a little work)
(version: 0)
Comparing performance of:
sync vs async vs syncAnon
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var sync = i => document.body.attributes[0]?.name + i; var a_sync = async i => {await Promise.resolve(); return document.body.attributes[0]?.name + i;} var syncAnon = function syncAnon(i){return document.body.attributes[0]?.name + i;}
Tests:
sync
for (let i = 0; i < 100; i++) sync(i);
async
for (let i = 0; i < 100; i++) a_sync(i);
syncAnon
for (let i = 0; i < 100; i++) syncAnon(i);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
sync
async
syncAnon
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
async vs sync
sync vs promise
async function w/microtask vs sync function
Async vs Callback
Comments
Confirm delete:
Do you really want to delete benchmark?