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

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



Hi,

On keskiviikko 17 huhtikuu 2013, Alan Hourihane wrote:
> > Currently it's assumed that this is the culprit for bad performance,
> > it will hopefully be soon verified (by removal of this call &
> > re-testing).

Douglas said that the performance doubled without gettimeofday()
(which was wrongly also using the timezone arg).

Helmut's "TZ" comment might also give another reason for things to
be slow(er) on TOS.


> mktime() is a very bad performer - known fact. One of the packages
> I was building decided mktime() was too slow and deemed it unusable
> because it took longer than 60 seconds (when compiled with m68000,
> m68020-60 is quicker, but still slow.)

Ok...

> > > nanosleep() (not used in Quake) is even worse:
> > - it uses gettimeofday() (with NULL timezone parameter),
> > - then it does select(), which on TOS returns error I think, and
> > - as result it will call gettimeofday() again.
> > 
> > nanosleep() can, and is used, for shorter sleeps than sleep(), so
> > it taking a lot more CPU than sleep(), especially on TOS, is IMHO
> > not really acceptable.
> 
> Feel free to optimize !

Timezone stuff I'll leave to somebody who actually knows what
it's supposed to do...


> It would be good to have much better performing
> functions on the mintlib.

I'm mainly interested in TOS performance, would a patch to
shortcircuit nanosleep() to _clock() when running without
MiNT be acceptable?

Currently the problem is that gettimeofday() gets called twice...


	- Eero