gnome_get_language_from_locale is too slow
@oholy
Submitted by Ondrej Holy Assigned to Desktop Maintainers
Link to original bug (#744477)
Description
gnome_get_language_from_locale runs about 2-3 seconds on my system for first time. We use it in gnome-control-center (in region and user-accounts panel). When you open e.g. user-accounts panel after boot, ui freezes for 2-3 seconds. It seems it is caused by collect_locales_from_localebin, which is spawning "locale -a" command.
Wouldn't be possible to precache it e.g. after login? Or do you have another idea?
I've made simple program to test:
g_get_current_time (&t); g_print ("%s\n", g_time_val_to_iso8601 (&t)); gnome_get_language_from_locale ("en_US.utf8", NULL); g_get_current_time (&t); g_print ("%s\n", g_time_val_to_iso8601 (&t));
It gives following result for first time:
2015-02-05T08:16:41.295279Z 2015-02-05T08:16:43.416387Z