Time zone cache is constantly invalidated if TZ is NULL
Scrolling the nautilus list view or resizing the nautilus window has become very slow in 3.38 and this seems to be related to time zone changes in glib 2.66.
According to sysprof nautilus is spending almost all of the time in
g_time_zone_new(), which gets called from
g_time_zone_new_local(). This is used from nautilus via
g_date_time_new_local() to generate the string used for the file modification date.
I don't have the
TZ environment variable set, so
g_getenv ("TZ") in
g_time_zone_new_local() will always return
NULL meaning the cached local timezone will never be used. Maybe if the environment variable is
NULL the default local time zone identifier could be used instead so the cache will still work? But that depends on how much faster getting the local time zone identifier is than creating a new time zone. Or maybe the modification time of
/etc/localtime could be used on unix instead of trying to parse it every time?
The commit that made the performance difference noticeable is 25d950b6, before that time zone related functions took up only a fraction of the time when resizing the nautilus window.