02-25-2007 01:34 AM
02-25-2007 03:16 AM
02-25-2007 02:05 PM
02-25-2007 07:26 PM - edited 02-25-2007 07:26 PM

Message Edited by Jim Kring on 02-25-2007 05:26 PM
02-25-2007 08:28 PM
@altenbach wrote:
Many years ago (I think it was during the first LabVIEW challenge), I noticed that a case structure with two cases is always faster than a case with more than two cases.
I expect a search is required to associate a specific-selector value with it's case. I'd hoped when the number of possible selector-values was "small", they would just create a table of case#s, one for every possible selector value - then the case-selection would be as fast as a table-lookup.![]()
32bit data, 16bit lookup: 22ms!!
At more than double the original speed, this could be a worthwhile "upgrade" (wonder if David is till following?)LabVIEW 8.0+ also has U64. So:
64bit data, 16bit lookup: 20ms!!!(probably not worth it)(I challenge you to make a multicase structure for the 16bit situation! 🐵
Hmm, there's only 12870 values to type (worst case) ![]()
02-26-2007 02:58 AM
@Jim Kring wrote:
I have no idea about the performance when comparing large files.
Unfortunately, I don't have the openG stuff installed at the moment, but your file comparison is a slightly different problem because we only need to know if two files of equal size a different or not, a boolean. (It does not report e.g. the number of differences found).
You would probably simply use a WHILE loop and then exit at the first difference found. It would only become expensive with huge files differeing only near the very end of the file, for example.
08-09-2007 07:30 PM
08-10-2007 06:47 AM
@dusty_g wrote:
I'm a super beginner at labview...and i need to do the same thing shown here basically. I need to take two huge text files and compare them to see if they are the same and if they're not then i need to know where and what wasn't the same. Altenbach's example works pretty good, except my file is huge so if the difference is way down in the file you cant see where the error is at. How would find the location of the error easier?
If you don't really need to do it with LabVIEW, Unix (Linux...) has some very powerfull commands to stream though huge textfiles and create various outputs of the resulting differences. However since I can't remember the commands (with that endless possible options) writing an simple LabView program might be faster than digging in the unix help files....
08-10-2007 08:29 AM
I must have missed this thread before but it just perc'ed its way up near the top again.
All the optimization stuff was fun to read through, but I thought that the original poster had additional concerns in the initial post (though he seemed satisfied with what was addressed when he chimed in). Also, dusty_g shares one of them.
I don't have LV nearby (or much spare time) to participate now, but anyone want to take a shot at the following mods:
1. Keep track of the indices of all u8 bytes that are different. Could be simply a matter of pre-allocating an array then trimming at the end. But I'm a little curious about the very general case where you might want both speed and a small memory footprint, i.e., you're not allowed to pre-allocate a huge array as big as the arrays to be compared. Considering that the differences might be either sparse or dense, how might you approach this?
2. Instead of 1 count for # different bytes, how about 8 counts so that # differences can be tracked for each bit individually? What other/better methods are there besides a 256x8 lookup table that requires you to copy out a 1x8 array for summing?
-Kevin P.