Skip to content

file: Re-use local time zone when generating date string

Whenever g_time_zone_new_local() is called it has to check the file
system for changes, because the system's time zone might have changed
since the last call. This function was called multiple times for each
file when generating the date string, which was causing some unnecessary
overhead.

This changes the code to re-use the local time zone from the first call.

This is the bit from !601 (closed) that still makes sense with the current gtk4 list view based nautilus. I've opened this as a new MR, because none of the old discussions from that MR are relevant anymore. I also added the comment requested in !601 (comment 924480).

@coreyberla did some testing with a change like this and it reduced the loading time for a large folder from 10s to 8s.

Merge request reports