home .. forth .. colorforth mail list archive ..

RE: [colorforth] FS/Forth for DOS: crude performance test


> I implemented code to test this compared to other forms, and 
> found out that it
> was actually the slowest method of native code generation.  
> Even for various
> threading mechanisms, accessing the stack using indexed 
> addressing modes is
> about 17% faster than using PUSH and POP, even if you 
> optimize out the XCHG
> instructions.
> 
[...]
> I find it is faster to do something like this instead:
> 
> : XOR   XOR AX,[BP]   LEA BP,[BP+2] ;
> 

I think that what makes the "exchange" technique slower is precisely the
exchanges, because PUSH and POP are to me the fastest way to fetch/store
memory words. So I'm a bit puzzled by your 17% figure. I'm also surprised by
your XOR example. INC costs only 2 cycles whereas IIRC costs much more.
But my instruction timings are for the 8086. Probably the timings are
different for higher processors. I read that happens to be the case for
LODSW which slower than MOV AX,[SI]+ INC SI,2 whereas on charts that's the
reverse.

 Amicalement,
  Frederic

" You live at your own risks"

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com