MathGroup Archive 2005

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

Search the Archive

Need help with optimization

  • To: mathgroup at
  • Subject: [mg59152] Need help with optimization
  • From: PaulMcHale <Paul.McHale at>
  • Date: Sat, 30 Jul 2005 01:25:38 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

The following had very different execution times:

(*11571 seconds)
myPlots = 
  Table[  {
      Plot[myPolys[[i]], {x, 1, maxX}]}, 
      {i,1, lengthMax} ];

(*38 seconds   300x improvement*)
myPlots = 
      Evaluate[myPolys[[i]], {x, 1,maxX}], 
      {i, 1, lengthMax}]

(*0.7 seconds   55x more improvement,  including the plot*)
myPlots = Plot[Evaluate[myPolys], {x, 1, maxX}];

Where can I go to get the best advice on programming?  It is clear Mathematica can run extremely fast.  It can also run horribly slow.  How does one tell?  These numbers are similar on 5.2.  Maybe 6.0 will pre-compile or somehow optimize on it's own.


  • Prev by Date: Re: PlotLegend & Tick marks in MultipleListPlot
  • Next by Date: Re: Add terms surrounded by zero together in matrix
  • Previous by thread: Interpolation of function
  • Next by thread: Re: Mathematica 5.2 and mathssh