Vectorization

June 9, 2009 at 7:29 pm | In Gravity, Physics | Leave a Comment

When your mommy tells you that you should vectorize Octave/MATLAB code, she means it. A couple hours spent neatly vectorizing a short but important piece of simulation code yielded, perhaps unsurprisingly, a 3+ order of magnitude speedup.

slow

The unvectorized code needed to produce this plot is still running – has been since mid-afternoon. It’s now 40% done at 8:30 pm.

fast


The vectorized code produced this higher resolution and wider ranged result in about a minute, using only half the chip.

Yes, Virginia, the plots look really boring. That’s actually good.

No Comments Yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.