Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #16896 > unrolled thread

GA144 and test the new word "asd" : speed test

Started byemmanuel <emmanuel.said@cern.ch>
First post2012-10-31 12:38 -0700
Last post2012-11-08 10:12 -0500
Articles 7 — 5 participants

Back to article view | Back to comp.lang.forth


Contents

  GA144 and  test the new word "asd"  :  speed test emmanuel <emmanuel.said@cern.ch> - 2012-10-31 12:38 -0700
    Re: GA144 and  test the new word "asd"  :  speed test Howerd <howerdo@yahoo.co.uk> - 2012-11-01 01:13 -0700
    Re: GA144 and  test the new word "asd"  :  speed test rickman <gnuarm@gmail.com> - 2012-10-31 21:29 -0400
      Re: GA144 and  test the new word "asd"  :  speed test "Ed" <invalid@nospam.com> - 2012-11-03 15:42 +1100
    Re: GA144 and  test the new word "asd"  :  speed test David Stubbs <stubbsd@genialgenetics.com> - 2012-11-06 23:28 -0800
      Re: GA144 and  test the new word "asd"  :  speed test emmanuel <emmanuel.said@cern.ch> - 2012-11-06 23:49 -0800
        Re: GA144 and  test the new word "asd"  :  speed test rickman <gnuarm@gmail.com> - 2012-11-08 10:12 -0500

#16896 — GA144 and test the new word "asd" : speed test

Fromemmanuel <emmanuel.said@cern.ch>
Date2012-10-31 12:38 -0700
SubjectGA144 and test the new word "asd" : speed test
Message-ID<3634564f-07d6-47d6-8e31-aa17f1060f72@googlegroups.com>
Hi,

In the comp lang forth , you have a result of speed test about ": asd"
 , see "Ga144 polyforth".

3 seconds whith Polyforth (the same with eForth). 

I'm very happy to test the new word asd with my favourite GA144.

: asd 1000 for 1000 for 0 drop next next;

the result is 15ms  !!!!

you can see my web page, so it's in French but you can understand except Gavino.


http://esaid.free.fr/tutoriel_arrayforth/Ga144_asd/asd_GA144.htm


Best regards 

Emmanuel

[toc] | [next] | [standalone]


#16931

FromHowerd <howerdo@yahoo.co.uk>
Date2012-11-01 01:13 -0700
Message-ID<3ea955aa-79cf-4787-9b4f-fd0f2ce9b7e9@googlegroups.com>
In reply to#16896
On Wednesday, 31 October 2012 20:38:55 UTC+1, emmanuel  wrote:
> Hi,
> 
> 
> 
> In the comp lang forth , you have a result of speed test about ": asd"
> 
>  , see "Ga144 polyforth".
> 
> 
> 
> 3 seconds whith Polyforth (the same with eForth). 
> 
> 
> 
> I'm very happy to test the new word asd with my favourite GA144.
> 
> 
> 
> : asd 1000 for 1000 for 0 drop next next;
> 
> 
> 
> the result is 15ms  !!!!
> 
> 
> 
> you can see my web page, so it's in French but you can understand except Gavino.
> 
> 
> 
> 
> 
> http://esaid.free.fr/tutoriel_arrayforth/Ga144_asd/asd_GA144.htm
> 
> 
> 
> 
> 
> Best regards 
> 
> 
> 
> Emmanuel

Hi Emmanuel,

Excellent! 15ms means that the F18 runs Forth primitives at ~66.6MHz :-)

One of the reasons I wanted polyForth or eForth is for the multi-tasker, but with the GA144 maybe I don't need it, because it is multi-core.
It requires a different way of thinking...

Thanks for sharing this,

Best regards,
Howerd

[toc] | [prev] | [next] | [standalone]


#16938

Fromrickman <gnuarm@gmail.com>
Date2012-10-31 21:29 -0400
Message-ID<k6u351$sbp$2@dont-email.me>
In reply to#16896
On 10/31/2012 3:38 PM, emmanuel wrote:
> Hi,
>
> In the comp lang forth , you have a result of speed test about ": asd"
>   , see "Ga144 polyforth".
>
> 3 seconds whith Polyforth (the same with eForth).
>
> I'm very happy to test the new word asd with my favourite GA144.
>
> : asd 1000 for 1000 for 0 drop next next;
>
> the result is 15ms  !!!!
>
> you can see my web page, so it's in French but you can understand except Gavino.
>
>
> http://esaid.free.fr/tutoriel_arrayforth/Ga144_asd/asd_GA144.htm
>
>
> Best regards
>
> Emmanuel

Hi Emmanuel,

Have you done any work with your board?  I'd like to hear about it.

Here is a test of my knowledge of the GA144 instruction set.  At first 
pass, I expect the machine code produced by your source was

   @p push . .
   1000 (literal data)
outerloop:
   @p push . .
   1000 (literal data)
   @p drop unext .
   0 (literal data)
   next outerloop

The inner loop (@p drop unext) would take (5 + 1.4 + 2.4) or 7.8 ns or 
7.8 us for the total inner loop.  The outer loop only adds some 15 ns to 
this time for an estimated <8 ms total time.

One important side effect is that this code won't work!  Each time 
through the inner loop when the literal 0 is accessed the PC will be 
incremented and when the loop is exited it will be 999 words past the 
location closing the outer loop.  So you can't use a literal in a unext 
loop.

One fix it to use a different way to get the literal 0.  The data stack 
could be initialized to all 0s before the loop is entered with one 
literal and 9 dups.  Then the code could just do the drop, but that is 
not really in the spirit of the benchmark.  Otherwise the instructions 
DUP DUP OR could be used to generate a 0 from whatever is on the stack. 
  But then the loop would be five opcodes meaning you can't use a unext 
loop.  Fastest would be to store a 0 in the A register, then it could be 
retrieved with the a instruction as
a drop unext .

This would be only 5.2 ns per inner loop or <6 ms for the full 
benchmark.  Obviously what was done was to use the much slower and 
larger next rather than the micronext instruction.

   @p push . .
   1000 (literal data)
outerloop:
   @p push . .
   1000 (literal data)
innerloop:
   @p drop . .
   0 (literal data)
   next innerloop
   next outerloop

Now the PC gets reset to the correct place every time through the loop 
and the literal is read correctly.  But the timing is...  (5 + 1.4 + 1.4 
+ 1.4 + 1.2 + 5.2) or 15.6 ns or nearly 16 ms total which is about what 
you measured.

Unfortunately this benchmark does not show the GA144 running at optimal 
speed which is three times faster.  But to get that sort of optimal 
utility takes a lot of work to learn how and to do such optimizations.

Rick

PS  Gavino means well, he is just a misguided youth.

[toc] | [prev] | [next] | [standalone]


#17007

From"Ed" <invalid@nospam.com>
Date2012-11-03 15:42 +1100
Message-ID<k727bv$ols$1@speranza.aioe.org>
In reply to#16938
rickman wrote:
> ...
> Unfortunately this benchmark does not show the GA144 running at optimal
> speed which is three times faster.  But to get that sort of optimal
> utility takes a lot of work to learn how and to do such optimizations.

Also to know when the effort is not justified.  There may be reasons
other than speed for wishing to run Eforth or PolyForth on a GA chip.
One would need to ask the folks who implemented them and the
intended audience.

One hesitates to draw any conclusion from benchmarks involving
[nearly] empty loops.  Except possibly the futility of them.




[toc] | [prev] | [next] | [standalone]


#17103

FromDavid Stubbs <stubbsd@genialgenetics.com>
Date2012-11-06 23:28 -0800
Message-ID<12523679-dab1-4520-8905-24fc904ae20d@googlegroups.com>
In reply to#16896
Hi Emmanuel,

I believe the inner loop could be changed to micro next (unext), might save a little time?

: asd 1000 for 1000 for 0 drop unext next ; 

Kind Regards,

David.




On Wednesday, 31 October 2012 12:38:55 UTC-7, emmanuel  wrote:
> Hi,
> 
> 
> 
> In the comp lang forth , you have a result of speed test about ": asd"
> 
>  , see "Ga144 polyforth".
> 
> 
> 
> 3 seconds whith Polyforth (the same with eForth). 
> 
> 
> 
> I'm very happy to test the new word asd with my favourite GA144.
> 
> 
> 
> : asd 1000 for 1000 for 0 drop next next;
> 
> 
> 
> the result is 15ms  !!!!
> 
> 
> 
> you can see my web page, so it's in French but you can understand except Gavino.
> 
> 
> 
> 
> 
> http://esaid.free.fr/tutoriel_arrayforth/Ga144_asd/asd_GA144.htm
> 
> 
> 
> 
> 
> Best regards 
> 
> 
> 
> Emmanuel

[toc] | [prev] | [next] | [standalone]


#17104

Fromemmanuel <emmanuel.said@cern.ch>
Date2012-11-06 23:49 -0800
Message-ID<611d8cf3-8547-4fe6-b82c-cbd33b571d46@googlegroups.com>
In reply to#17103
Hi David,

it's interesting but  you can't use a literal in a unext loop (see the answer to rickman , thank's a lot).
the new word like this seem working : 

:asd 1000 for 1000 for dup dup or drop next next ;


cheers 

Emmanuel 

[toc] | [prev] | [next] | [standalone]


#17162

Fromrickman <gnuarm@gmail.com>
Date2012-11-08 10:12 -0500
Message-ID<k7gi4a$38m$1@dont-email.me>
In reply to#17104
On 11/7/2012 2:49 AM, emmanuel wrote:
> Hi David,
>
> it's interesting but  you can't use a literal in a unext loop (see the answer to rickman , thank's a lot).
> the new word like this seem working :
>
> :asd 1000 for 1000 for dup dup or drop next next ;
>
>
> cheers
>
> Emmanuel

If you wanted to optimize this for speed in the way Chuck would do it, 
try this...

: asd 1000 dup dup dup dup dup dup dup dup  \ nearly fill stack
     for for dup or drop unext next ;

This may be different from the benchmark, but it will give you the 
fastest speed and is valid in the sense of measuring the time for the 
fastest loop possible with this machine.  The only thing that would 
speed this code is to reduce the code inside the inner loop.  Also note 
that the code in the inner loop can't be any longer either... you can 
only have four instructions including the unext.

Rick

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web