Zum Hauptinhalt springen
••••••••••••••••••••••••••••••••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Packed vs Holey Arrays in V8: Why new Array(n) Makes Spread 4x Slower

Two arrays. Same million numbers, in the same order, with no gaps in either: const a = []; for (let i = 0; i < 1_000_000; i++) a.push(i); const b = new…

Beitrag
0
Seite
0
↗ Quelle (DEV Community)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Two arrays. Same million numbers, in the same order, with no gaps in either: const a = []; for (let i = 0; i &lt; 1_000_000; i++) a.push(i); const b = new Array(1_000_000); for (let i = 0; i &lt; 1_000_000; i++) b[i] = i; Copy each one with spread: [...a]: 0.17 ms [...b]: 0.71 ms Same contents, same length, and b takes four times as long to copy.... Weiterlesen: Packed vs Holey Arrays in V8: Why new Array(n) Makes Spread 4x Slower

Intelligence Digest — free The top security news daily · unsubscribe anytime
Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
No reader ratings yet
Was this page helpful?
0
Jetzt Bewertung abgeben
🟢 Niedrig (1-3.9) 🟡 Mittel (4.0-6.9) 🔴 Hoch (7.0-8.9) Kritisch (9.0-10.0)

Related story clusters & sources (vector AI)

Pull to refresh
Nächster Beitrag