News for hackers. Stuff that matters.
Re:Sparse Array Destructuring in JavaScript by tonto on Thursday November 17, 2022 @12:36AM (#33635383)
maybe interesting: the obj destructuring may be a bit faster than array destructuing. setup a small benchmark here https://jsbench.me/eolakmvsor/1

just storing the data and accessing it as a tuple seems to not be the significantly slow part, but instead its destructuring the array that can be a bit slow. i remember seeing some threads with e.g. useState hooks in react needing array destructuring optimizations, but appears to still be a bit slower https://docs.google.com/document/d/1hWb-lQW4NSG9yRpyyiAA_9Kt...

There are no comments on this comment yet.