advise on future of glibc (mktime issue)

Nix nix@esperi.org.uk
Wed Jun 8 00:03:00 GMT 2005


On Tue, 07 Jun 2005, Jairo stated:
> Now, the kernel keeps track of the time and the current timezone, why

The kernel does not know the current timezone.

In any case, since you're calling mktime() so much, /etc/localtime will
be in cache: so you're comparing the cost of a kernel ring transition
and file lookup with the hypothetical cost of a kernel ring transition
and timezone lookup. Even given the open()/close() overhead, I can't
believe you'd gain that much.


Possibly an improvement is to track the time_t at which the timezone was
last checked, and throttle the rate of rechecks to one per minute or
something like that. I don't think millions of checks per second are of
any real use to anyone.

Am I missing something? If not, I'll whip up a patch that does that
(against HEAD, as this is unlikely to be suitable for the stable branch:
I can roll one against 2.3.5 anyway, if Jairo wants).

-- 
`It's as bizarre an intrusion as, I don't know, the hobbits coming home
 to find that the Shire has been taken over by gangsta rappers.'



More information about the Libc-alpha mailing list