Duansg commented on PR #948: URL: https://github.com/apache/fesod/pull/948#issuecomment-4982986684
@psxjoy thanks for your suggestion, i have supplemented and revised the related issues Caching - Modify the cache to be a nested `Map<Locale, Map<String, Formatter>>`: where `locale` serves as the outer key and `pattern` as the inner key—thereby avoiding the need to assign a composite string key consisting of `locale` and `pattern` to each cell. - Both levels use bounded FIFO eviction so long-lived threads can't grow the cache without bound. Tests - Added @ResourceLock(Resources.LOCALE) to tests that mutate the global default locale, preventing races with other locale-sensitive tests under parallel execution. Performance (local benchmark, 3 runs) ```markdown ┌──────────────┬─────────────┬────────────┬────────┬──────────────┬─────────────┬─────────┐ │ Benchmark │ Time before │ Time after │ Time Δ │ Alloc before │ Alloc after │ Alloc Δ │ ├──────────────┼─────────────┼────────────┼────────┼──────────────┼─────────────┼─────────┤ │ dateFormat │ 223.5 ns │ 99.8 ns │ −55% │ 760 B │ 160 B │ −79% │ ├──────────────┼─────────────┼────────────┼────────┼──────────────┼─────────────┼─────────┤ │ dateParse │ 379.0 ns │ 251.9 ns │ −34% │ 1256 B │ 656 B │ −48% │ ├──────────────┼─────────────┼────────────┼────────┼──────────────┼─────────────┼─────────┤ │ numberFormat │ 594.2 ns │ 265.5 ns │ −55% │ 1781 B │ 216 B │ −88% │ ├──────────────┼─────────────┼────────────┼────────┼──────────────┼─────────────┼─────────┤ │ numberParse │ 301.7 ns │ 123.9 ns │ −59% │ 1717 B │ 248 B │ −86% │ └──────────────┴─────────────┴────────────┴────────┴──────────────┴─────────────┴─────────┘ ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
