On the other hand, the presence of 0 in the left
matrix product argument makes things go faster.
This is due to +/@(*"1 _)) being used in the
implementation of +/ .* .  (It'd be too expensive
to check for 0s in the conventional "school"
method.)  I rememeber telling Ken about this
unexpected beneficial effect of using +/@(*"1 _)
in late summer 2004 and he was pleased.

http://www.jsoftware.com/books/help/release/pdt504.htm

   y=: 200 200 [EMAIL PROTECTED] 0
   ts 'x +/ .* y' [ x=: -: 200 200 [EMAIL PROTECTED] 2e6
0.0198073 525376
   ts 'x +/ .* y' [ x=: -: 1e5 < 200 200 [EMAIL PROTECTED] 2e6 
0.0192737 525376
   ts 'x +/ .* y' [ x=: -: 1.0e6 < 200 200 [EMAIL PROTECTED] 2e6
0.011155 525376
   ts 'x +/ .* y' [ x=: -: 1.1e6 < 200 200 [EMAIL PROTECTED] 2e6
0.0107463 525376
   ts 'x +/ .* y' [ x=: -: 1.2e6 < 200 200 [EMAIL PROTECTED] 2e6
0.00943779 525376
   ts 'x +/ .* y' [ x=: -: 1.3e6 < 200 200 [EMAIL PROTECTED] 2e6
0.00883325 525376
   ts 'x +/ .* y' [ x=: -: 1.4e6 < 200 200 [EMAIL PROTECTED] 2e6
0.00746883 525376
   ts 'x +/ .* y' [ x=: -: 1.5e6 < 200 200 [EMAIL PROTECTED] 2e6
0.00692798 525376
   ts 'x +/ .* y' [ x=: -: 1.7e6 < 200 200 [EMAIL PROTECTED] 2e6
0.0045869 525376
   ts 'x +/ .* y' [ x=: -: 1.8e6 < 200 200 [EMAIL PROTECTED] 2e6
0.00361778 525376
   ts 'x +/ .* y' [ x=: -: 1.9e6 < 200 200 [EMAIL PROTECTED] 2e6
0.00298166 525376



----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Saturday, September 2, 2006 5:29 am
Subject: Re: [Jprogramming] Timing of some matrix products

> I strongly suspect that the variations in timings 
> are due to  _ (infinity).  _ occurs with higher 
> probability in %?.>:200 200$200 than in 
> %?.>:200 200$200000.  
> 
> The timing variations are also hardware dependent.
> In Google, enter "Pentium 4 infinity multiply speed"
> and select the first search result (from Cyngus).


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to