Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Multiplication vs Additions
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Multiplication
11039.9 Ops/sec
Additions
524.5 Ops/sec
Script Preparation code:
const randInt = () => Math.floor(Math.random() * 100); var arr = Array.from({ length: 10000 }, () => randInt());
Tests:
Multiplication
let total = 0; for (const v of arr) { total += 100 * v; } console.log(total);
Additions
let total = 0; for (const v of arr) { for (let i = 100; 0 < i--;) total += v; } console.log(total);