Re: Why is GForth-ITC fast?
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Why is GForth-ITC fast?         

Group: comp.lang.forth · Group Profile
Author: brian.fox
Date: May 1, 2008 19:44

On May 1, 8:53 pm, m...@iae.nl (Marcel Hendrix) wrote:
> brian....@rogers.com writes Re: Why is GForth-ITC fast?
> [..]
>
>> variable x
>
> \ Suggest:
> 1024 allot
>
>
>
>
>
>> : test!
>> 100 0 do
>> 30000 0 do
>> \ 100 ! store ops
>> i x ! i x ! i x ! i x ! i x ! i x ! i x ! i x ! i x ! i x !
> [..]
>> loop
>> loop ;
>> \ Benchmarks done on AMD Sempron 1.6 GHz, with 1 Gb RAM; Windows XP SP2
>> \ Hs/Forth
>> \ elapse test!
>> \ Elapsed time =00:00:05.22 ok
>> \ Hs/Forth
>> \ elapse test!!
>> \ Elapsed time =00:00:05.22 ok
>> \ 28%% slower than GForth (below)
>
> These timings are ridiculous. Test! takes 180 ms on my PIV 3 GHz.
> Does it help if you add a gap between variable x and test! ?
>
> -marcel

It didn't make a difference.

Here is a screen cut and paste with another test where I replaced
all ! ops with 100 empty do loops. Not sure how your machine is so
much faster!

Gforth 0.6.2, Copyright (C) 1995-2003 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
include elapsed.fs ok
include nexttest.fs ok
ok
elapse test!
Elapsed time: 00:00:03.880 ok
elapse test!
Elapsed time: 00:00:03.885 ok
elapse test!
Elapsed time: 00:00:03.882 ok
: testloop2 compiled
100 0 do compiled
30000 0 do compiled
compiled
100 0 do loop compiled
compiled
loop compiled
loop ; ok
elapse testloop2
Elapsed time: 00:00:01.743 ok

Brian
no comments
diggit! del.icio.us! reddit!