[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] MiNTlib timing related functions behavior/performance



Eero Tamminen <oak@helsinkinet.fi> writes:

> By far most of the time in Quake startup, and in rendering a frame
> in Doom, is spent by localtime.o from MiNTlib, between these symbols
> in the binary:
> ---
> d0fd0 T localtime.o
> d30fc T _tzsetwall
> ---
> tzsetwall is symbol from localtime, but for some reason there are no
> symbols before that in the linked in localtime.o content, although
> one can see them with "mn":
> ---------------------
> $ ar x libc.a
> $ nm localtime.o | sort -n
> ...
>          U _strncpy
> 000025e6 T _tzset
> 000027ae T _mktime
> 000027c6 T _timelocal
> 000027dc T _timegm
> 000027fc T _timeoff
> 0000274a T _gmtime_r
> 0000275e T _offtime
> 0000278a T _ctime_r
> 0000281e T _time2posix
> 00002572 T _tzsetwall
> ...
> ---------------------

How comes that _tzsetwall is the symbol with the lowest address?

> However, gettimeofday():
> * uses Tgettimeofday() on MiNT and Tgettime() & Tgetdate() on TOS.
> * Then it does mktime() which does timezone stuff, and if non-null
>   value is given as timezone arg (like Quake does), it will also
>   call timezone stuff directly.

What does Quake need the timezone for?  This is long obsolete.

But mintlib should not be calling the localtime stuff for the timezone,
this is meant to be the _kernel_'s idea of the timezone.  If MiNT does
not keep track of a time zone gettimeofday should just return zero in
the timezone argument.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."