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

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



> -----Message d'origine-----
> De : Samuel Falvo [mailto:falvosa@xxxxxxxxx]
> Envoyé : lun. 23 juin 2003 21:41
> À : colorforth@xxxxxxxxxxxxxxxxxx; machineforth@xxxxxxxxxxxxxxxxxx
> Objet : [colorforth] FS/Forth for DOS: crude performance test
> 
> 
> I entered the following program in a block:
> 
> : i 1+ 1- 15 * 16 / 2* 2* 2/ 2/ DUP DROP DUP DROP SWAP SWAP ; 
>   ( test 1 )
> : i ;                                                         
>   ( test 2 )
> 
> : 8i i i i i i i i i ;
> : 64i 8i 8i 8i 8i 8i 8i 8i 8i ;
> : 512i 64i 64i 64i 64i 64i 64i 64i 64i ;
> : 4ki 512i 512i 512i 512i 512i 512i 512i 512i ;
> : 32ki 4ki 4ki 4ki 4ki 4ki 4ki 4ki 4ki ;
> : 256ki 32ki 32ki 32ki 32ki 32ki 32ki 32ki 32ki ;
> : 2mi 256ki 256ki 256ki 256ki 256ki 256ki 256ki 256ki ;
> : 16mi 2mi 2mi 2mi 2mi 2mi 2mi 2mi 2mi ;
> : run 0 16mi DROP ;
> 
> I executed run under both PygmyForth and FS/Forth for DOS.  
> The platform is a
> 80486 33MHz processor with 8MB of RAM, with *I think* 512K of 
> cache, but I'm
> not sure.  It's a Toshiba Satellite laptop, T2100.
> 
> Test 1:  exercises some commonly used math/stack ops
>   PygmyForth: 63s
>   FS/Forth:   53s
> 
> Test 2:  exercises subroutine call overheads
>   PygmyForth:  9s
>   FS/Forth:    1.5s (approximately -- we're getting into 
> noise floor here!)
> 
[...]
> 
> Even so, FS/Forth is faster than PygmyForth, though only 
> slightly.  For most
> applications, however, there will not be a noticable difference.
> 
> Some things to consider about FS/Forth:
> 
> 1.  It's constantly exchanging BP and SP to selectively gain 
> access to the data
> stack.  It's aggressive about keeping SP the return stack 
[...]
> 
> 2.  Primitives ARE NOT compiled inline; hence +, -, *, /, 
> U/MOD, et. al. are
> all encoded as subroutine calls, which means CALL and RET 
[...]
> 
> Despite these deficiencies (which will utterly disappear in 
> the Linux version
> of FS/Forth, which WILL be a MachineForth), FS/Forth is still 
> slightly faster
> than PygmyForth.  I am very pleased with the results.  Things 
> can only improve
> from here.
> 
I think that 4IM ( http://membres.lycos.fr/astrobe ) may interest you.
I'm also interested in comparing performances of our systems.
4IM is subroutine threade with code inlining. I've chosen to you AX as stack
pointer and
SP as return stack pointer because XCHG AX SP is one byte long and uses only
3 cycles, which
allowed me to inline DROP, DUP and co. in the size of a call. 
> --
> Samuel A. Falvo II
> 

 Amicalement,
  Frederic

" The thruth is a horizon"


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