2

Consider this example(taken from Thomas's question here)

rv = RandomVariate[ExponentialDistribution[2], 10^6];
t = AbsoluteTime[]; ListLinePlot[rv, PlotRange -> All]
AbsoluteTime[] - t (*Put this line into the NEXT cell,and evaluate \
both cells together*)

t = AbsoluteTime[];
Style[ListLinePlot[rv, PlotRange -> All], Antialiasing -> False]
AbsoluteTime[] - t (*This line in separate cell!*)

and this example (taken from a related question here)

ls = Table[Sinc[x*y], {x, -10, 10, 0.1}, {y, -10, 10, 0.1}];
ListPlot3D[ls, PlotRange -> All, 
  InterpolationOrder -> 2] // AbsoluteTiming

I get different performance in version 8 and version 9. Version 8 seems to be about twice as fast as version 9. Why this happens and how to make version 9 as fast as version 8?

enter image description here enter image description here

xslittlegrass
  • 27,549
  • 9
  • 97
  • 186
  • since I have both installed, i get ~7 sec with v9 vs 6 sec with v8 for your second example. – george2079 May 29 '13 at 18:33
  • If I had to guess, I would guess Mathematica didn't change anything about their internals, but Mac OSX forced new compiled applications to use newer APIs. Mathematica 8.0 is using the old APIs which just happen to be faster then the new API that Mathematica 9.0 is being forced to use. I have experienced such speed changes, when Mac has down this before. Are using and older laptop/computer? The newer API's are probably be partially virtualized, while the older API's are using native hardware. – William May 29 '13 at 19:24
  • 2
    isn't that how software evolution works: newer versions fix some bugs, add others and become slower :-) – Albert Retey May 30 '13 at 11:04
  • fwiw my relatively smaller slowdown was with windows. – george2079 May 30 '13 at 12:24
  • @Liam does that means other softwares also experience the same problem as MMA does? But I seems not notice the problem in Matlab. – xslittlegrass May 30 '13 at 15:01
  • @xslittlegrass The systems are complex enough that you can't really be sure w/o some reverse engineering (which I am not very good at, or really now how to do) which APIs are used by which applications and how the generally work. Sorry :| I wish I could help, but I am not really up to data on how the systems work, just speculating – William May 30 '13 at 15:10
  • @Liam that's fine, you are helping by providing new ideas. Thanks :) – xslittlegrass May 30 '13 at 15:14
  • I can reproduce the large difference on OS X (3.3 s in 8 vs 7.9 s in 9). But the difference is not in graphics rendering speed, but in box conversion speed. Try AbsoluteTiming[ToBoxes@ListLinePlot[rv, PlotRange -> All];] in both 8 and 9. So it's likely not because of system APIs, @Liam, but because of Mathematica itself. – Szabolcs Jun 05 '13 at 12:08

0 Answers0