mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 17:06:31 -06:00
PERF: Preload JsLocaleHelper.load_translations
for default locale. (#13041)
In production, each Unicorn child process will currently hold the default locale in memory on first load. Instead, we should preload it in the Unicorn master process so that the memory is immediately shared when forking. Also, the translations are only memoized on first load now and is adding considerable overhead to the first few requests after a fresh boot.
This commit is contained in:
parent
034a0493e3
commit
f05f5fde0f
@ -933,6 +933,8 @@ module Discourse
|
||||
# this will force Cppjieba to preload if any site has it
|
||||
# enabled allowing it to be reused between all child processes
|
||||
Search.prepare_data("test")
|
||||
|
||||
JsLocaleHelper.load_translations(SiteSetting.default_locale)
|
||||
end
|
||||
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user