Frontend/perf: Cache Intl.DateTimeFormat objects.#8122
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 Release NotesThis PR does not need to be included in release notes. Reason: This is a small frontend performance optimization that caches date formatter objects internally. While it may slightly improve efficiency, it does not introduce a user-visible feature, significant UX change, important bug fix, or major infrastructure improvement that end users would notice in release notes. 🤖 Bot Debug InformationModel: |
Adds a cache for
Intl.DateTimeFormatobjects since I read around the internet that it's recommended and this benchmark confirms it's much faster on my machine.Unbounded cache size growth isn't a concern. This will clear on navigation and I expect the most different formats a given page will have will be in the low single digits.
Testing
Verified two different date formats can still be shown.
Web frontend checklist
For maintainers