Closed
Description
#7 and #8 showed that new DateTimeFormat()
is astoundingly expensive in time and memory. Big perf wins come from caching these instances.
The constructor for DateTimeFormat in this polyfill (which is called in every toLocaleString call) calls the builtin Intl.DateTimeFormat
constructor 8 times. This will be slooooooooooow.
All those instances are probably unnecessary. At a minimum, we should lazy-init these instances so they're only constructed when needed. Given that users typically re-use the same options over and over, we could also consider caching DateTimeFormat instances too.
Metadata
Metadata
Assignees
Labels
No labels