While I have been working on some other PRs I noticed that for 5% of the runtime for layouting large albums listings was spent for localization of the date/time.
For each album/photo the JS engine built a DateTimeFormat object internally when Date::toLocaleString was called. This PR swaps it. The DateTimeFormat object is only built once globally, and then we use DateTimeFormat::format(date) to localize the date.
While I have been working on some other PRs I noticed that for 5% of the runtime for layouting large albums listings was spent for localization of the date/time.
For each album/photo the JS engine built a
DateTimeFormat
object internally whenDate::toLocaleString
was called. This PR swaps it. TheDateTimeFormat
object is only built once globally, and then we useDateTimeFormat::format(date)
to localize the date.