Re: Unbearably slow plotting (v6)David Bailey,http://www.dbaileyconsultancy.co.uk
- To: mathgroup at smc.vnet.net
- Subject: [mg79577] Re: Unbearably slow plotting (v6)David Bailey,http://www.dbaileyconsultancy.co.uk
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Mon, 30 Jul 2007 06:39:26 -0400 (EDT)
- References: <f8h450$6km$1@smc.vnet.net>
Bill Rowe wrote: > On 7/28/07 at 5:25 AM, thomas.muench at gmail.com (thomas) wrote: > >> Now, v6.0.1 came out, claiming to have improved speed of ListPlot, >> ListLinePlot, etc, so I thought I give it another try comparing the >> speeds of the various versions. The results are quiet sad. > >> Here are the versions (all installed on the same machine): 5.2: >> In[1]:= $Version Out[1]= 5.2 for Microsoft Windows (June 20, 2005) > >> 6.0: In[1]:= $Version Out[1]= "6.0 for Microsoft Windows (32-bit) >> (April 27, 2007)" > >> 6.0.1: In[1]:= $Version Out[1]= "6.0 for Microsoft Windows (32-bit) >> (June 19, 2007)" > >> In each version, I created some fake data: In[2]:= >> SeedRandom[1];data=Table[Random[],{10^6}]; > >> Then I "ListPlot"-ed it, while measuring the time: In[3]:= t = >> AbsoluteTime[]; ListPlot[data] // Print; Print[AbsoluteTime[] - t]; >> (Note: using this "AbsoluteTime[]" construct rather then >> Timing[ListPlot[...]] also counts the time needed for rendering the >> plot in the FrontEnd) > > Hmm... I didn't try doing this plot in earlier versions of > Mathematica. But I did try this on my Apple G4 PowerBook for > various size arrays using version 6.01 and got the following results: > > k plot time > > 1E3 .3 seconds > 1E4 .6 seconds > 1E5 6 seconds > 1E6 67 seconds > > =46or what I would consider reasonable plots (10,000) points or > less the time to plot and render was less than 1 second. > > With 1E5 and 1E6 points, this results in a plot that is > indistinguishable from a filled rectangle. That seems to be of > very little use. So, while I might be a bit impatient waiting > for Mathematica on my machine to plot 1E6 points, I don't see > why I would want to do that in the first place. What I want from > ListPlot is something to give me an idea of trends in my data. > Given real limits on display resolution and size, plotting 1E6 > points typically will not provide a useful plot regardless of > how fast it plots. So why do this? > -- > To reply via email subtract one hundred and four > The main reason people do this, is that they have experimental data which they want to visualise without having to filter it in some way to remove redundant data points. I came across a similar problem in which a client wanted to graph 14000 points, each with a different colour. This was trivial in 5.2 using an explicit list of RGBColor and Point constructs, but unacceptably slow in 6.0. The problem seems to be that in such cases the kernel needs to transmit a large irregular structure to the FE. My solution was to write my points to an array which I used to create a Raster object. This eliminated the speed problem, although I did not bother with exact timing measurements, as these can be difficult in situations in which much of the time is lost in the FE. David Bailey http://www.dbaileyconsultancy.co.uk