Speed of En Masse Operations

Speed of En Masse Operations

Just in case you thought I was kidding in the article on en masse operations, I decided to offer some proof of the speed advantages they can give you.

I used the Timing Template vi (Click to download the template ) to measure the time it takes to multiply an array of DBLs by two, both with a loop, and without. ?I set up the timing VI to create an array of 1000 random numbers, and then time the multiply operation.

First, the loop method, where you auto-index every value out of the array, multiply it, and auto-index it back in:

Speed of 1000 multiplies, using FOR loop

As you can see, this took 7.47 uSec per loop. ?Not all that shabby. ?But just removing the loop lets the en masse operation do it:

Speed of same 1000 multiplies, en masse

Holy Speed Demon, Batman! ?That’s 0.77 uSec or about ONE TENTH the time!

Now, I’m not guaranteeing that all such operations will save you that much time, but if you have a chance to use them, then you should!

It’s easier on you and easier on the hardware!

Enjoy


要查看或添加评论,请登录

James Steven Bird的更多文章

  • Beware Simplicity

    Beware Simplicity

    If you read the post about en masse operations, you might remember that I pointed out that you should know what is…

  • Monster Panel, part 5

    Monster Panel, part 5

    In Part 1, recall from the requirements that we want: — A chart, showing the history of 1-4 channels. The history can…

  • Monster Panel, part 4

    Monster Panel, part 4

    In Part 3, we talked about how to take 3672 copies of a 300-channel list and cut the memory requirements down to size…

  • Monster Panel, part 3

    Monster Panel, part 3

    In Part 1 I gave the rough outline of the task: how to manage over 12000 controls/indicators on one panel. In Part 2…

  • Monster Panel, part 2

    Monster Panel, part 2

    In Part 1, I gave the rough outline of the task: How to manage over 12000 controls/indicators on one panel. The first…

  • Monster Panel, part 1

    Monster Panel, part 1

    LabVIEW programmers progress from the excitement of the new paradigm to just using it as a tool. We’ve all produced…

  • An Analog Clock

    An Analog Clock

    If you want to display a time-of-day clock in LabVIEW, it takes three seconds to plop down a TIMESTAMP indicator, and…

  • The Next Step in TCP-IP

    The Next Step in TCP-IP

    A question came up on the LabVIEW forum the other day about multiple connections, and how hard it was to have two…

  • Needle in the Haystack

    Needle in the Haystack

    Scientists are not programmers. Repeat that after me: scientists are not programmers.

  • A Beginner's Guide to TCP-IP

    A Beginner's Guide to TCP-IP

    I guess this Internet thing is here to stay, huh? It can be daunting at first, what with looking at the complexities of…

社区洞察

其他会员也浏览了