Message Boards Message Boards

0
|
7359 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Idea for speed up evaluation?

Posted 9 years ago

This code here

R[n_] := (SeedRandom[n]; RandomReal[])

Export[NotebookDirectory[] <> "test.avi", 
 Table[Table[
   Show[Table[
     Plot[80 - 
       m + .2*Sin[
         2 Pi*R[6*m] + 
          Sum[4*Sin[2 Pi*R[4*m] + t + R[2 n*m]*2 Pi]*
            Exp[-(.3*x + 30 - 1*100*R[2 n*m])^2/20], {n, 1, 30, 1}]] +
        Sum[3 (1 + R[3*n*m])*Abs[Sin[t + R[n*m]*2 Pi]]*
         Exp[-(x - 1*100*R[n*m])^2/20], {n, 1, 4, 1}], {x, -50, 150}, 
      PlotStyle -> Directive[White, Thick], 
      PlotRange -> {{-50, 150}, {0, 85}}, Background -> Black, 
      Filling -> Axis, FillingStyle -> Black, Axes -> False, 
      AspectRatio -> Full, ImageSize -> {1920, 1080}], {m, 1, 80, 
      1}]], {t, 0, 6.3*18/19, 6.3/38}]]]

is running for 2 days now and still not finished. Any ideas how to get evaluation much faster? Where exactly can I improve it with ParallelTable for example?

Other ideas for a good speedup?

POSTED BY: Michael Steffen
Posted 9 years ago

First of all, there appears to be a syntax error. The outer Table has no index specification. That in itself shouldn't be impacting speed, but it may be an indication that the code isn't doing what you intend it to be doing.

Rather than start trying random optimizations, I'd suggest you decompose your code so you can inspect each piece of it for performance problems. Start with smaller tables. Separate out the computation from the Plot. Decompose the core computation itself and test the performance of each. Once you've identified the main performance problem, tackle that one specifically.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract