Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
NextTick Implementation in GameLoop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
Set
718.1 Ops/sec
For
3938.2 Ops/sec
For []
2391.8 Ops/sec
While
2666.3 Ops/sec
While If
2718.1 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const ticks = 1000; const length = 10; let arr = []; const set = new Set();
Tests:
Set
for(let tickCount = 0; tickCount < ticks; tickCount++){ // NextTick for(const c of set){ c(); } set.clear(); // Game for(let i = 0; i < length; i++){ set.add(() => Math.random()); } }
For
for(let tickCount = 0; tickCount < ticks; tickCount++){ // NextTick arr.forEach((c) => c()); arr.length = 0; // Game for(let i = 0; i < length; i++){ arr.push(() => Math.random()); } }
For []
for(let tickCount = 0; tickCount < ticks; tickCount++){ // NextTick arr.forEach((c) => c()); arr = []; // Game for(let i = 0; i < length; i++){ arr.push(() => Math.random()); } }
While
for(let tickCount = 0; tickCount < ticks; tickCount++){ // NextTick while(true){ const c = arr.pop(); if(c === undefined) break; c(); } arr = []; // Game for(let i = 0; i < length; i++){ arr.push(() => Math.random()); } }
While If
for(let tickCount = 0; tickCount < ticks; tickCount++){ if(arr.length){ // NextTick while(true){ const c = arr.pop(); if(c === undefined) break; c(); } arr = []; } // Game for(let i = 0; i < length; i++){ arr.push(() => Math.random()); } }