LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing input to information in a .csv file using Read from Spreadsheet

Solved!
Go to solution

Evaluating one element at is a very inefficient way of processing an array of data.

 

Think about the simple case of where you have an array of strings and you want to find the first element that matches a given input value. You could pass the array into a while loop and loop through the data until you either find a match or run out of data. In determining the efficiency of this code there are two factors: How well did you when writing the code, and how good the optimization logic is in the LV compiler.

 

Alternatively, you could use the search 1d array node (like I recommended) to do the same thing. In that case, the efficiency of that part of the process is solely dependent upon how optimized that lower-level code is - code that in some cases is hand-optimized to make it as fast and efficient as possible.

 

Now which do you think is going to do a better job?

 

In the code I described, the logic is simpler and smaller. It also scales better. Over the years I have seen a lot of code that worked well at first but as the size of the data grew, the systems came to a grinding halt because the inherent inefficiency of the algorithims overwhelmed the processors.

 

Right now I'm working on fixing an application that ran fine on the developer's octal-core Win7 development machine. The problem is that the customer needed the code to be able to run on an old dual-core PC running WinXP.

 

I'm reminded of someone who once observed that defining "best practices" isn't primarily to keep people from reinventing the wheel. It's to keep them from reinventing the flat tire.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 11 of 11
(318 Views)