This is part of a series of PRs based on performance work we have done to
improve a use-case involving parsing/formatting hundreds of thousands of dates
where luxon was the bottleneck.
Profiles reveal that a substantial portion of fromFormat time is spent in digitsRegex. It is only called from unitsForToken and it is always called with 11 suffixes to match different numbers of digits.
There are 21 numbering systems, so a fully expanded cache would hold 11*21 = 231 regexes.
This is part of a series of PRs based on performance work we have done to improve a use-case involving parsing/formatting hundreds of thousands of dates where luxon was the bottleneck.
Profiles reveal that a substantial portion of fromFormat time is spent in digitsRegex. It is only called from unitsForToken and it is always called with 11 suffixes to match different numbers of digits.
There are 21 numbering systems, so a fully expanded cache would hold 11*21 = 231 regexes.
This is related to https://github.com/moment/luxon/pull/1530 , but involves a much more restricted cache
Benchmark Comparison (
name | before | after | after/before
):