If he has J6.01, which is using the old floating-point
unit, a factor of 2x-5x could be had from the tightest
coding using SSE instructions; and then if MatLab uses
multiple cores effectively, a 10x performance diff is not out
of the question.

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Roger Hui
> Sent: Thursday, November 08, 2007 5:51 PM
> To: Programming forum
> Subject: Re: [Jprogramming] Re: speed of matrix*vector operation
> 
> > The j version runs about a factor of 10 slower than the
> > matlab version, but at least my earlier timing dropped from
> > 2.5 minutes to about 5 seconds.
> 
> Yes, but have you included the time to generate the
> random numbers in your MatLab benchmark?
> Because you are including it in your J benchmark.
> The following illustrates the difference:
> 
>    1000 * 1000 (6!:2) '(?256$0)+/ . *?256 312$0'
> 6.22474
> 
>    x=: 256 [EMAIL PROTECTED] 0
>    y=: 256 312 [EMAIL PROTECTED] 0
>    1000 * 1000 (6!:2) 'x +/ .* y'
> 0.56505
> 
> For something as common and as important as matrix multiply 
> I imagine that MatLab would have had the best efforts of 
> their hotshot implementers.  Likewise in J.  I am skeptical
> that the MatLab hotshot implementers would be better than 
> the J hotshot implementers by a factor of 10.
> 
> p.s. Have you tried the Hilbert matrix experiment?
> 
> 
> 
> 
> ----- Original Message -----
> From: [EMAIL PROTECTED]
> Date: Thursday, November 8, 2007 14:35
> Subject: [Jprogramming] Re: speed of matrix*vector operation
> To: [email protected]
> 
> > Sorry, I did not properly explain my problem.
> > 
> > Anyhow, by using:
> > 
> >     1000 (6!:2) '(?256$0)+/ . *?256 312$0'
> > 0.0052153
> > 
> > which is about 5.2 seconds to do 1000 iterations of the
> > matrix times vector multiply.
> > 
> > BIG reduction in time obtained by using ordinary numbers and
> > NOT using extended precision numbers.
> > 
> > Also, not writing a program is cool.
> > 
> > The j version runs about a factor of 10 slower than the
> > matlab version, but at least my earlier timing dropped from
> > 2.5 minutes to about 5 seconds.
> > 
> > thanks a lot for the ideas.
> 
>  
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

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

Reply via email to