Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Need help with optimization

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

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 = 
  Table[Plot[
      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.

Paul


  • 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