βItβs only work if somebody makes you do it.β β’ craft code β’ creative ideas β’ cutting edge β’ author β’ senior front end architect β’ professional scuba diver β’ adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
I'm curious how the performance compares to:
Especially in the case of large arrays, I'm not sure what the implications are (if any) to spreading a large array to function arguments
Try this - the first method seems to be about 10 times as fast
Interestingly, if you switch to a typed array, the results are reversed -
reduce
is 10 times as fast on Firefox, and nearly twice as fast on ChromeAnd unsurprisingly, this is even faster:
Thank you both for the performance analysis, it's very helpful to have these additional details :)