Hi Jürgen,

The box is a Dell Dimension 2400, with a 2.4 ghz P4, running Win 7 Pro.
GNU APL is under 32 bit Cygwin, and APL2 is also installed.

Since D is '0123456789' and Z←10|Z, the only possible source of an index
error there is if you didn't set  ⎕IO←0.

Regards,

Mike


On Sat, Aug 22, 2015 at 11:54 AM, Juergen Sauermann <
juergen.sauerm...@t-online.de> wrote:

> Hi Mike,
>
> the only thing I am getting is:
>
> *INDEX ERROR+*
> *TIMES[7]  Z←((¯1+⍴Z)⌊+/∧\'0'=Z)↓Z←D[⌽Z]*
>                                   ^^
>
> Another question: are you running GNU APL on the same machine as IBM APL2
> or under a GNU/Linux emulator like *cygwin*?
>
> /// Jürgen
>
>
> On 08/22/2015 06:24 AM, Mike Duvos wrote:
>
> One more little benchmark, this time doing a variety of primitives.
>
>       ⎕IO←0
>
>      ∇
> [0]   TIME X;TS
> [1]   TS←⎕TS
> [2]   ⍎X
> [3]   (⍕(24 60 60 1000⊥¯4↑⎕TS-TS)÷1000),' Seconds.'
>     ∇
>
>     ∇
> [0]   Z←SHOW X;I
> [1]   Z←(I,50)⍴(50×I←⌈(⍴X)÷50)↑X←,X
>     ∇
>
>     ∇
> [0]   Z←X TIMES Y;D;I;C
> [1]   Z←+⌿(-⍳⍴X)⌽Z←((⍴X),(⍴X)+⍴Y)↑Z←(D⍳X←⌽,X)∘.×(D←'0123456789')⍳Y←⌽,Y
> [2]   I←¯1◊C←0
> [3]  L1:→((I←I+1)⍴Z)/L2
> [4]   C←⌊(÷10)×Z[I]←Z[I]+C
> [5]   Z[I]←10|Z[I]
> [6]   →L1
> [7]  L2:Z←((¯1+⍴Z)⌊+/∧\'0'=Z)↓Z←D[⌽Z]
>     ∇
>
>     ∇
> [0]   Z←FACTORIAL N;I
> [1]   Z←,'1'◊I←1
> [2]  L1:→((I←I+1)>N)/0
> [3]   Z←Z TIMES⍕I
> [4]   →L1
>     ∇
>
> [IBM APL2]
>
>       TIME 'SHOW FACTORIAL 300'
> 30605751221644063603537046129726862938858880417357
> 69994167767412594765331767168674655152914224775733
> 49939147888701726368864263907759003154226842927906
> 97455984122547693027195460400801221577625217685425
> 59653569035067887252643218962642993652045764488303
> 88909753943489625436053225980776521270822437639449
> 12012867867536830571229368194364995646049816645022
> 77165001851765464693401122260347297240663332585835
> 06870150169794168850353752137554910289126407157154
> 83028228493795263658014523523315693648223343679925
> 45940952768206080622328123873838808170496000000000
> 00000000000000000000000000000000000000000000000000
> 000000000000000
> 2.078 Seconds.
>
> [GNU APL]
>
>       TIME 'SHOW FACTORIAL 300'
> 30605751221644063603537046129726862938858880417357
> 69994167767412594765331767168674655152914224775733
> 49939147888701726368864263907759003154226842927906
> 97455984122547693027195460400801221577625217685425
> 59653569035067887252643218962642993652045764488303
> 88909753943489625436053225980776521270822437639449
> 12012867867536830571229368194364995646049816645022
> 77165001851765464693401122260347297240663332585835
> 06870150169794168850353752137554910289126407157154
> 83028228493795263658014523523315693648223343679925
> 45940952768206080622328123873838808170496000000000
> 00000000000000000000000000000000000000000000000000
> 000000000000000
> 52.547 Seconds.
>
> I see these numbers, ~2 seconds and  ~52 seconds a lot, so I will conclude
> object-oriented APL is about 25 times as slow as fine-tuned machine
> language APL.  Not too bad a penalty for portability across a wide spectrum
> of CPU architectures and Operating Systems.
>
> With modern commodity processors doing billion of instructions per second,
> most people probably won't even notice.
>
>
>
>

Reply via email to