Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Tuple vs object speed
Two element tuple vs two property object
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0
Browser:
Firefox 146
Operating system:
Linux
Device Platform:
Desktop
Date tested:
4 months ago
Test name
Executions per second
Tuple
4253.4 Ops/sec
Record
6169.4 Ops/sec
Tests:
Tuple
const tuples = [] for( var i = 0; i < 10000; i++ ){ tuples.push([1,i]); } let sum = 0; for( const tuple of tuples){ sum += tuple[0]; } if( sum !== 10000 ) { console.log("FAIL!") }
Record
const tuples = [] for( var i = 0; i < 10000; i++ ){ tuples.push({start:1,end:i}); } let sum = 0; for( const tuple of tuples){ sum += tuple.start; } if( sum !== 10000 ) { console.log("FAIL!") }