Hi,

I wanted to measure the performance of the comparison operator Value.'==', and I do not understand the results I get.

local
   T1=test(a b c d e f g h i j k l m n o p a b c d e f g h i j k l m n)
   T2=test(a b c d e f g h i j k l m n o p a b c d e f g h i j k l m n)
   T3=T1
   proc {Time Desc P}
      T
   in
      T={Property.get 'time.total'}
      {P}
      {System.showInfo Desc#
       " finished in "#({Property.get 'time.total'}-T)#" ms"}
   end
in
   %% TEST1
   {Time "T1==T2"
    proc {$} for I in 1;I<1000000;I+1 do _=T1==T2 end end}

   T1=T2

   %% TEST2
   {Time "T1==T2 (2)"
    proc {$} for I in 1;I<1000000;I+1 do _=T1==T2 end end}

   %% TEST3
   {Time "T1==T3"
    proc {$} for I in 1;I<1000000;I+1 do _=T1==T3 end end}
end

Results:
T1==T2 finished in 687 ms
T1==T2 (2) finished in 688 ms
T1==T3 finished in 78 ms


TEST1 and TEST2 perform equally, even though T1 is unified with T2 before TEST2. Shouldn't TEST2 be as fast as TEST3?

Thanks,
Filip

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to