Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Spread Vs Destructure vs naiive in variable assignment
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/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
11 months ago
Benchmark engine:
Benchmark.js
Spread
216.9M/s
Destructure
213.7M/s
Naiive
198.7M/s
View exact numbers
Test name
Executions per second
✓
Spread
216,931,312 Ops/sec
Destructure
213,652,704 Ops/sec
Naiive
198,673,744 Ops/sec
Script Preparation code:
var input = [1, 2, 3];
Tests:
Spread
const [a, b, c] = input;
Destructure
const {0: a, 1: b, 2: c} = input;
Naiive
const a = input[0]; const b = input[1]; const c = input[2];