Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Mar 1999 17:02:56 +0100
From:      Marc Olzheim <marcolz@stack.nl>
To:        stable@freebsd.org
Subject:   tzset in libc
Message-ID:  <19990303170256.A15288@stack.nl>

next in thread | raw e-mail | index | archive | help

Hi,

I was wondering why it was that each time you call localtime() or strftime(),
tzset() is called also. Isn't it so that it only has to be called once
per process and then be regearded as already set ?

Why I am asking this is because when I profiled a program of mine that called
localtime() about 2 million times it also called getenv() 2 million times
also. And since getenv() is a relatively slow operation, it yielded more
than 50% performance when I patched libc not to call tzset() each time.

When the timezone changes, you'd have to call tzset() manually, but in my
case, it's worth it.

Just curious....

Marc


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990303170256.A15288>