[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 281360] 4.7.1: file picker hangs reading localtime over and over
From:       David Jarvie <djarvie () kde ! org>
Date:       2012-03-31 22:35:45
Message-ID: bug-281360-17878-rewG3gbetp () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=281360

David Jarvie <djarvie@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|kdelibs-bugs@kde.org        |djarvie@kde.org
     Ever confirmed|0                           |1

--- Comment #7 from David Jarvie <djarvie@kde.org> ---
KSystemTimeZone functions use libc functions to obtain time zone data. If data
is required for a time zone which is not the current system time zone, it's
necessary to call tzset() first to specify the time zone to use, and then
tzset() again on exit to restore the current system time zone. It seems that
tzset() reads the time zone definition file each time it's called. So for each
offsetAtZoneTime() call, time zone files are read twice. In the case of
multiple successive calls for data from the same time zone, there will be many
reads of the same time zone file, which is plainly very time consuming and
wasteful.

To fix this, I think KSystemTimeZone needs to use KTzfileTimeZone instead of
using libc functions. This should make it possible to only read each time zone
file a single time. I'll look at implementing this.

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic