performance with integers
Posted: Wed Jul 04, 2012 9:25 am
I am looking forward performance in my code.
I met a situation that I cannot explain to myself.
Please look at following code:
Thanks for any hint.
I met a situation that I cannot explain to myself.
Please look at following code:
Code: Select all
m2←9999 9⍴⍳999
m1←9999 9⍴⍳999 ⋄ m1[;4]←1.2
⍝ I can explain next comparison
cmpx '{m1[;4]←1.12 ⋄ 0}⍬ ' '{m2[;4]←1025⋄ 0}⍬'
{m1[;4]←1.12 ⋄ 0}⍬ 3.7E¯5 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
{m2[;4]←1025⋄ 0}⍬ 1.3E¯5 -67% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
⍝ but I cannot explain next comparison
cmpx '{m1[;4]←1.3 ⋄ 0}⍬ ' '{m2[;4]←12⋄ 0}⍬'
{m1[;4]←1.3 ⋄ 0}⍬ 3.6E¯5 0% ⎕⎕⎕⎕⎕⎕
{m2[;4]←12⋄ 0}⍬ 2.5E¯4 +577% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
Thanks for any hint.