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

List:       kde-core-devel
Subject:    Re: Caching local time zone
From:       johnflux () gmail ! com
Date:       2006-09-21 10:08:17
Message-ID: 43d8ce650609210308y5859a98tc75f88d4e32111c7 () mail ! gmail ! com
[Download RAW message or body]

Hi,
  A timer for such a thing is usually a bad idea.  If there is a
specific file that changes then you could watch that file for changes.

  However I think it would be best to just make a small test case to
actually time it.  Then see if it is worth optomizing.  Like you say,
the file is cached etc.

On 21/09/06, David Jarvie <lists@astrojar.org.uk> wrote:
> Using KDateTime for date/times in the local time zone can potentially result
> in very frequent calls to KSystemTimeZones::local() which fetches
> and returns the current local system time zone. Depending on the system,
> that function may open and read files, and compare their contents.
> Even if the files are still cached (as would usually be the case on a UNIX
> system when the function calls are made in quick succession), the
> overhead in file system function calls makes me feel uneasy when the
> function could be called many times a second if arrays of date/time values
> are being converted to or from the local time zone.
>
> Plainly, the system time zone is not going to change frequently, so I think
> that it would be better to cache it and only reread it periodically. I
> propose to set a timer to refresh it once a minute. Any comments/objections?
>
> Note that this caching applies to the time *zone* (e.g. "Europe/Paris"). It
> has no impact on the handling of daylight saving time shifts which will
> still be handled without any time lag.
>
> --
> David Jarvie.
> KAlarm author & maintainer.
> http://www.astrojar.org.uk/linux/kalarm.html
>
>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

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