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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
With destructuring
211435120.0 Ops/sec
Without destructuring
224299568.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};