Jump to content

Array Manipulation Performance Testing


Recommended Posts

OpenG made an amazing set of Array tools, many years ago.  They weren't perfect but had many uses and I've recommended many times.  Improvements to LabVIEW meant some of the array functions weren't well optimized.  Years later I tried making a more modern Array set of tools using VIMs, giving up on Polymorphics.  I posted this as a package over on VIPM.IO here.

Since then I've thought about a few places where performance of my stuff could be better.  Mads and I have had some discussions back and forth in this thread.  But I wanted to make a separate post where others could chime in with their performance suggestions too.

At the moment my Array VIMs are in LabVIEW 2018.  However I think due to the potential Maps and Sets benefit, that I want to go to at least 2019.  In 2020 LabVIEW added the Sorted Array subpalette with a pretty decent binary search.  So for now I think LabVIEW 2020 will be what I target for the next Array VIMs package release.  Any thoughts on this?  I know there is a decent amount of bias in this, but Jim posted the versions of LabVIEW used on VIPM.IO and 2020 and newer covered over 75% of users.

So attached is zip with a set of array testing VIs.  For instance open the Remove Dups Speed VI and run it.  It will run through the 6 different methods of removing duplicates from a 1D array of strings.  It will then graph the different methods and do a check that they all return the same data.  If you want to add your own method edit the (non-typed) enum, then duplicate a case and replace the function with your won code.  It randomizes the order of the array methods used.  You can also mess with the data being used.  At the moment it generates 1000 unique elements, then duplicates them 5 times. If you want to enter data with none to remove, or all of a single type, or whatever then you can change the data to be used in the test.

At the moment there are 8 different array speed tests to compare.  Things like Delete 1D, Delete 2D, Filter 1D, Filter 1D with a Scalar, Reverse 2D, Search 1D, and the Remove Duplicates already mentioned.  There might not be a single best method for a specific function.  There are times one method will work better for some set of data, and then a decision needs to be made on what should go in the VIM.  My main reason for making this thread is that I hope some people will know of a better way to do something.  Come up with a more optimized way to do any of the OpenG array functions.

After some discussion, and contribution I plan on updating the Array VIMs package and attribute those that helped. (crosspost)

Edit: I just realized someone is probably yelling "Use Git" to me.  I hadn't thought of that sorry, it just felt organic to continue the conversation here because it is where the topic started.

872707096_HooovahhArrayPerformanceTest.zip

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.