Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Destructure vs Assign
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
test and assign individual
235522.9 Ops/sec
destructure
222250.7 Ops/sec
Tests:
test and assign individual
const pixelArray = [5,[1,6],9,[1,8],7,[1,3],4,[1,3],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,10],6,[1,10],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],35] pixelArray.forEach(item=>{ let color, count if (Array.isArray(item)) { color = item[0] count = item[1] } else { color = 0 count = item } color += count /* code */ })
destructure
const pixelArray = [5,[1,6],9,[1,8],7,[1,3],4,[1,3],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,10],6,[1,10],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],6,[1,2],35] pixelArray.forEach(item=>{ let [color, count] = Array.isArray(item) ? item : [0, item] color += count /* code */ })