Subject: Re: speeding up microtime
To: David Laight <david@l8s.co.uk>
From: Jukka Marin <jmarin@pyy.jmp.fi>
List: port-i386
Date: 08/02/2002 13:43:16
On Thu, Aug 01, 2002 at 05:30:44PM +0100, David Laight wrote:
> > This cut the execution time for gettimeofday() call from
> > about 6.3us to 4.1us by removing 2 of the 4 'inb' instructions
> > from the usual code path.
> > I expect the 'standard' code takes 5us since I'd already made
> > other changes to the same bit of code.
> 
> It was 5.3us
> 
> I've just reworked it again to avoid reading the status from
> the interrupt controller.  Test program gives 2.85us
> unfortunately it doesn't quite work :-( and I have to go out.

Would it be possible to use the various counters present on the decent
pentium CPU's and their relatives?  Accesses to original pc hardware
timers is slow, but accessing the CPU counters is much faster.

5 µs sounds like an eternity on a fast CPU.. thousands of instruction
cycles wasted! :-I

Disclaimer: I don't actually _know_ the CPU architecture :-)

  -jm