4 ms·
91.86% slower on my Android phone with Firefox, so it definitely depends on which JS engine.
by debugnik 2y ago
91.86% slower on my Android phone with Firefox, so it definitely depends on which JS engine.
- vanderZwan 2y agoYeah, absolutely. With the linked benchmark I just got the following results on desktop Linux: - 17M ops/s ± 1.65% for array destructuring in Chrome - 169M ops/s ± 0.78% for object destructuring in Chrome - 545M ops/s ± 3.68% for array destructuring in Firefox - 81M ops/s ± 0.8% for object destructuring in Firefox So per the principle of "optimize for the bottleneck", one could choose to use object destructuring, because the slowest Firefox is still comparable to the fastest Chrome option. Or when, for example, you're running Node on a server and know which JS engine you're using.
- vbezhenar 2y ago77M ops/s ± 0.31%; 1.3B ops/s ± 0.17% for Safari. Difference is huge 800M ops/s ± 0.5%; 837M ops/s ± 0.32% for Chrome on the same computer.