Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12640 > unrolled thread

Re: Could someone help optimize this for Mathematica 9?

Started byBrett Champion <brettc@wolfram.com>
First post2012-12-05 08:10 +0000
Last post2012-12-05 08:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Could someone help optimize this for Mathematica 9? Brett Champion <brettc@wolfram.com> - 2012-12-05 08:10 +0000

#12640 — Re: Could someone help optimize this for Mathematica 9?

FromBrett Champion <brettc@wolfram.com>
Date2012-12-05 08:10 +0000
SubjectRe: Could someone help optimize this for Mathematica 9?
Message-ID<k9mvhd$b94$1@smc.vnet.net>
On Dec 4, 2012, at 3:14 AM, "McHale, Paul" <Paul.McHale@excelitas.com> 
wrote:

> We have a strong need to view large numbers of data points.  
Mathematica 8 was excellent at this.  The following code executed under 
both 8 and 9 (Windows):
>
> Mathematica 8: Less than 0.5 seconds
> Mathematica 9: Greater than 4 seconds
>
> mNumberSamples=100000;
> mFrequency=10;
> m=Table[{t/mNumberSamples ,Sin[t/mNumberSamples mFrequency*2 
\[Pi]]}*1.0,{t,1,mNumberSamples}];mStartTime=SessionTime[];
> ListLinePlot[m]
> mStopTime=SessionTime[];
> StringForm["Elapsed time = ``", N[mStopTime-mStartTime]]
>
> I have tried the code on a slower mac laptop (version 9 only) and had 
the same slower results.  Any input welcome as this functionality is 
extremely important to us.
>

This was caused by an oversight when updating ListLinePlot to support 
units for V9.  The fastest workaround I've found so far is to use:

m = Developer`ToPackedArray[ Table[...] ];

Depending on what options you're using to generate the plots, it may 
also be slightly faster to use ListPlot[m, Joined->True] instead of 
ListLinePlot[m].

Brett Champion
Wolfram Research

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web