Physics articles and information
RSS icon Home icon
  • Vectorization

    Posted on June 10th, 2009 admin No comments

    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.

    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google Bookmarks
    • De.lirio.us
    • Furl
    • MySpace
    • Ping.fm
    • Reddit
    • Spurl
    • StumbleUpon
    • Technorati
    • Tumblr
    • TwitThis
    • Yahoo! Buzz

    Leave a reply