Assumed the same. Then one day @_developit warned me about using `array.map`s & so my bytes have increased ever since...
-
-
I'm going to dig into V8 and let you know.
1 reply 0 retweets 3 likes -
So, I've been working on a lot more methods... Currently have 9 protos that are at least 50% faster than native
2 replies 0 retweets 2 likes -
Yes but i'm pretty sure there is a simple reason behind this. I haven't had the time to dig yet.
2 replies 0 retweets 0 likes -
Replying to @svensauleau @lukeed05 and2 replies 0 retweets 1 like
-
Replying to @svensauleau @lukeed05 and
I dont find it surprising that a loop is faster than .map(), I'm surprised a custom map() is faster than .map(), must be missing something
2 replies 0 retweets 7 likes -
Replying to @tjholowaychuk @svensauleau and
Array holes. Afaik that's the main reason of built-in Array methods not optimizing as well as custom impls that don't care about holes.
2 replies 0 retweets 1 like -
Replying to @RReverser @tjholowaychuk and
I believe it's more than that. My final optimization was to do `out=new Array(len)` but even before that, was still ~20x faster
1 reply 0 retweets 0 likes -
Replying to @lukeed05 @tjholowaychuk and
out=new Array(len) is fine. The problem is that by the spec you must preserve holes if they were present in original.
3 replies 0 retweets 5 likes -
Replying to @RReverser @lukeed05 and
new Array(n) creates a holey array for n > 0. In V8, the array is marked as holey forever (even when it becomes packed later)!
1 reply 0 retweets 1 like
Different optimization paths are taken for holey vs. non-holey elements kinds. In general though, non-holey is easier to optimize for
-
-
Replying to @mathias @RReverser and
I need to do this more often
You guys are great! Thank you for all the info~!1 reply 0 retweets 1 like - 1 more reply
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.