Project

General

Profile

Bug #31717

FastGettext initialization is slow

Added by Lukas Zapletal 9 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Internationalization
Target version:
-
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

It's because we switch over all 20 languages to actually pull language name in the native language into a list of available languages. We use that in three places: settings page, user page and GraphQL.

This can be easily made lazy-loaded, so those 2 seconds are not wasted during startup. Only few languages are usually used, definitely not all of them.


Related issues

Related to Foreman - Bug #31679: Actions that load the Rails stack are slowNew

Associated revisions

Revision b6b6ffc0 (diff)
Added by Lukáš Zapletal 6 months ago

Fixes #31717 - lazy-load fast_gettext for faster boot (#8275)

It's because we switch over all 20 languages to actually pull language name in the native language into a list of available languages. We use that in three places: settings page, user page and GraphQL.

This can be easily be lazy-loaded, so those 2 seconds are not wasted during startup. Only few languages are usually used, definitely not all of them.

Ewoud had a good point that this would prevent from sharing the translation cache (about 20MB) so we actually preload translations, but only in production. This way we can enjoy startups of Foreman in a dev environment by 2 seconds (which is actually 17% by local testing) while preloading everything in production (where the operation is a bit faster and reboot time not so painful).

History

#1 Updated by The Foreman Bot 9 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8275 added

#2 Updated by Ewoud Kohl van Wijngaarden 9 months ago

  • Related to Bug #31679: Actions that load the Rails stack are slow added

#3 Updated by The Foreman Bot 6 months ago

  • Fixed in Releases 3.0.0 added

#4 Updated by Anonymous 6 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Tomer Brisker 3 months ago

  • Category set to Internationalization

Also available in: Atom PDF