News for hackers. Stuff that matters.
Re:Ropes, an Alternative to Strings [pdf] (1995) by jcelerier on Monday November 02, 2020 @04:32AM (#24966182)
the question is, how often does it happen when compared to iterating over your loop ?

Like, every codebase I've worked on had some array sorting at some point in it... but the frequency of needing to sort something vs having to loop over all the X makes it a completely not-relevant thing.

If the only time you add an element to an array is as a result of the user clicking somewhere, then I'd say it's definitely not worth taking into account if your array isn't 5000000 elements (which it will likely won't be if you are giving the user the ability to just add something to it).

Re:Ropes, an Alternative to Strings [pdf] (1995) by konjin on Monday November 02, 2020 @07:52AM (#24967609)
Enough to explode a rocket every decade. Not everyone works on js.
Re:Ropes, an Alternative to Strings [pdf] (1995) by jcelerier on Monday November 02, 2020 @09:29AM (#24968427)
I would be very surprised if there is any code that could potentially allocate in the hot (lol) path of a rocket. There'll just be static arrays in there.