1. 19 Oct, 2020 4 commits
  2. 16 Oct, 2020 5 commits
  3. 15 Oct, 2020 5 commits
    • Philip Withnall's avatar
      tests: Add a basic test for GTimeZone caching · 976f48b4
      Philip Withnall authored
      
      
      This tests the previous few commits.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <pwithnall@endlessos.org>
      976f48b4
    • António Fernandes's avatar
      Revert "gtimezone: Cache timezones based on the identifier they were created by" · cfe593a3
      António Fernandes authored and Philip Withnall's avatar Philip Withnall committed
      This reverts commit 851241f1.
      
      That commit avoids a performance regression but introduces a behavior regression:
      changes to /etc/localtime have no effect for the remaining of the application's
      runtime.
      
      With the optimization introduced by the previous commit, we can pass NULL to
      g_time_zone_new() repeatedly with no performance drawback, so we no longer have
      to workaround this case.
      
      Fixes: #2224
      cfe593a3
    • António Fernandes's avatar
      gtimezone: Cache default timezone indefinitely · 3ab278da
      António Fernandes authored and Philip Withnall's avatar Philip Withnall committed
      We cache GTimeZone instances to avoid expensive construction when the
      same id is requested again.
      
      However, if the NULL id is passed to g_time_zone_new(), we always
      construct a new instance for the default/fallback timezone.
      
      With the recent introduction of some heavy calculations[1], repeated
      instance construction in such cases has visible performance impact in
      nautilus list view and other such GtkTreeView consumers.
      
      To avoid this, cache reference to a constructed default timezone and
      use it the next time g_time_zone_new() is called with NULL argument,
      as long as the default identifier doesn't change. We already did the
      same for the local timezone[2].
      
      Fixes: #2204
      
      Based on idea proposed by Sebastian Keller <skeller@gnome.org>.
      
      [1] 25d950b6
      [2] 551e8366
      3ab278da
    • António Fernandes's avatar
      gtimezone: Set resolved_identifier earlier · 19c5e13f
      António Fernandes authored and Philip Withnall's avatar Philip Withnall committed
      We have been passing a &resolved_identifier address around for multiple
      functions to set it. Each function may either:
      
          1.  leaving it for the next function to set, if returning early;
          2.  set it to a duplicate of the passed identifier, if not NULL;
          3.  get a fallback value and set it, otherwise.
      
      This can be simplified by setting it early to either:
      
          1.  a duplicate of the passed identifier, if not NULL;
          2.  a fallback value, otherwise.
      
      This way we can avoid some unnecessary string duplication and freeing.
      Also, on Windows, we avoid calling windows_default_tzname() twice.
      
      But the main motivation for this change is enabling the performance
      optimization in the next commit.
      19c5e13f
    • António Fernandes's avatar
      gtimezone: Split out fallback timezone identification for unix · 7124b91e
      António Fernandes authored and Philip Withnall's avatar Philip Withnall committed
      When the TZ environment variable is not set, we get the local timezone
      identifier by reading specific files.
      
      We are going to need these identifiers earlier, so split this logic into
      its own function, in preparation for the next commit.
      
      Based on idea proposed by Sebastian Keller <skeller@gnome.org>.
      7124b91e
  4. 14 Oct, 2020 4 commits
  5. 13 Oct, 2020 3 commits
  6. 12 Oct, 2020 1 commit
  7. 11 Oct, 2020 1 commit
  8. 07 Oct, 2020 3 commits
  9. 05 Oct, 2020 3 commits
  10. 01 Oct, 2020 5 commits
  11. 30 Sep, 2020 6 commits