@mathias Great talk. Thanks. Does a map on a packed HOLEY array return a PACKED or HOLEY?
e.g. Array(3).fill(1).map((_, i) => i) => [1,2,3] //HOLEY_ or _PACKED_
HOLEY arrays are still optimized, though! Going HOLEY is not the end of the world. If it makes sense to use `map` in your code, don’t stop doing so.
-
-
That's why I said least optimised. My experiences lead me to think that not using map and reduce is rare. I'll file this away under how I'd rewrite my js arrays if I need to squeeze more out of my code. Thanks for insights
-
I think that’s a good approach! Write idiomatic code that makes the most sense to you, and (only) when you run into a performance issue: 1) let
@v8js know so we can fix it, and 2) play around with avoiding holeyness to see if that makes a difference.
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.