moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.33k stars 730 forks source link

perf(partsOffset): allocate fixed size array #1508

Closed amilajack closed 8 months ago

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

diesieben07 commented 1 year ago

An even better way to do this would be to just use Array#map on formatted. This way we avoid having a "holey" or sparse array (i.e. an array with holes in it), which JS engines are less able to optimize.