Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.entries: loop vs reduce
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
reduce
18569788.0 Ops/sec
loop
20382078.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const multiplier = {} multiplier.millis = 1; multiplier.seconds = 1000 * multiplier.millis; multiplier.minutes = 60 * multiplier.seconds; multiplier.hours = 60 * multiplier.minutes; multiplier.days = 24 * multiplier.hours; multiplier.weeks = 7 * multiplier.days; multiplier.months = 4 * multiplier.weeks; multiplier.years = 365 * multiplier.months; const info = {hours: 5}
Tests:
reduce
const result = Object.entries(info).reduce((acc, [key, value]) => acc + (value * multiplier[key]), 0);
loop
let result = 0; for (const [key, value] of Object.entries(info)) { result += value * multiplier[key]; }