Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Destructuring vs direct usage
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
With destructuring
177421232.0 Ops/sec
Without destructuring
187762320.0 Ops/sec
Tests:
With destructuring
const obj = {a: 0, b: 1, c: "some string", d: [5,6], e: {x:0,y:0} }; const {a, b, c, d, e} = obj; const x = a + b; const y = c.length; const z = d[0] + d[1]; const pos = {x: e.x, y: e.y};
Without destructuring
const obj = {a: 0, b: 1, c: "some string", d: [5,6], e: {x:0,y:0} }; const x = obj.a + obj.b; const y = obj.c.length; const z = obj.d[0] + obj.d[1]; const pos = {x: obj.e.x, y: obj.e.y};