MathGroup Archive 1990

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Speeding Computations

  • To: mathgroup at yoda.ncsa.uiuc.edu
  • Subject: Re: Speeding Computations
  • From: James Spottiswoode <uunet!compuserve.com!76446.564>
  • Date: 13 Mar 90 22:06:58 EST

In reply to K. Suzuki,

Mathematica is indeed a wonderfully rich and powerful language.
But I doubt that it will ever have the speed of a lower level
language like Fortran 77, even if a compiled version were produced.  
I am new to the language,but I have found a couple of things which speed
up numerical analysis:

Avoid extracting elements of a list below the top level.  Transpose
or Flatten to get the required elements to the 'top' level.

Substitute dot products for summing operations where possible, e.g.
x = Table[i,{i,100}];
y = x;
Sum[x[[i]] y[[i]],{i,100}]//Timing
{0.7 Second, 338350}
x.y //Timing
{0.1 Second, 338350}

Has anyone any other advice for speeding the thing up, except faster
hardware???



  • Prev by Date: supressing argument evaluation by function Part
  • Next by Date: Re: Speeding Computations
  • Previous by thread: supressing argument evaluation by function Part
  • Next by thread: Re: Speeding Computations