bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Boolean Packing


From: Mike Duvos
Subject: Re: [Bug-apl] Boolean Packing
Date: Thu, 20 Aug 2015 21:49:49 -0700

Hi Elias,

It seems that there would be a substantial performance hit using C++ object management to construct your workspace.  I haven't run any benchmarks before, but perhaps a quick comparison with APL2 would be useful at this point.

Let's make a little function that does something 100 times.

      ∇DO100[⎕]∇
    ∇
[0]   DO100 X;I
[1]   I←¯1
[2]  L1:→((I←I+1)≥100)/0
[3]   ⍎X
[4]   →L1

    ∇ 2015-08-20 21.00.29.850 (GMT-7)

      

And another little function that prints out the number of seconds something takes.

      ∇TIME[⎕]∇
    ∇
[0]   TIME X;TS
[1]   TS←⎕TS
[2]   ⍎X
[3]   (⍕(24 60 60 1000⊥¯4↑⎕TS-TS)÷1000),' Seconds.'

    ∇ 2015-08-20 21.01.09.470 (GMT-7)

      

And an array of a million floats.

      A←1000 1000⍴⍳1E6

And a 100x100 boolean identity matrix

      B←100 100⍴101↑1=1

[IBM APL2]

      TIME  'DO100 ''A←⍉A'''
2.391 Seconds.

      TIME 'DO100 ''B←B∨.∧B'''
7.591 Seconds.

      TIME 'DO100 ''C←≠\B'''
0.197 Seconds.
     
[GNU APL]

      TIME    'DO100 ''A←⍉A'''
54.987 Seconds.

      TIME 'DO100 ''B←B∨.∧B'''
13.325  Seconds

      TIME 'DO100 ''C←≠\B'''
59.361 Seconds.
     
That's actually not too horrible, considering what it's having to do. 

Regards,

Mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]