LHF: Pre-load locale map at server startup #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Low-Hanging Fruit
File:
web/lib/apiHelpers.tsbuildItemFiltercallsgetServerLocaleMap()on EVERY invocation, which reads and parses two CSV files from disk (cached after first call viaglobalThis).Impact
After the first request,
getServerLocaleMap()returns the cached map — O(1). But the first request pays the full disk read + CSV parse cost (~200KB total). Acceptable for first request, but worth noting.Fix
None needed — the cache works correctly after first call. Just a note for observability.
Alternative
Pre-load the locale map at server startup instead of lazily on first request:
Effort
1 minute for the startup pre-load.