06-15-2011 02:29 AM
It's about 5 times faster according to my tests on a 100k*100 array of random values (about 50% negatives). How did you test it?
06-15-2011 03:14 AM - edited 06-15-2011 03:16 AM
On a 1e5 x 100 2D array as given in the original problem description, the code shown in the image below seems slightly (120ms vs.130ms, or about 10%) faster than IR&C. (Somewhat surpising since there are extra arrays allocated)
Mads: If you post benchmarks, please also attach your test program. (Make sure to avoide accidental folding or deadstripping and disable debugging). Thanks!
Here is my benchmark (LabVIEW 2010). Most likely exact results will depend on the CPU architecture and other factors, such as the LabVIEW version.
06-15-2011 04:39 AM
Mads,
I have attached captures of the vis used to benchmark..If you have any objections I would be glad to know since you're most definitely more experienced in Labview than myself..
Harry
06-15-2011 04:41 AM
Altenbach - the code you have seems 10% slower on my machine, not faster. Here's a benchmark VI.
06-15-2011 04:47 AM
Maybe the difference between your test and my test was the percentage of negatives... My sample array only had about 2-3% negatives since this is typically what I usually get...
06-15-2011 05:00 AM
The percentage of negative values does not seem to have any effect on the timing, nor does the range of the input values.
06-15-2011 09:10 AM - edited 06-15-2011 09:17 AM
Interesting results- don't you ever sleep?
I have to admit I thought of using IR&C but thought the math processor might be faster. Dropping the IR&C inside the looped in-place shows how much time penalty there is for a loop. Looks like a place to work on the optomizer since the loops really are not necessary.
06-15-2011 09:22 AM - edited 06-15-2011 09:22 AM
It helps to be in another time zone...but with a 3 month old baby at home - No
It was rather late when I posted the first reply though, so I did wonder if I was just too tired and had overlooked something when the solution seemed to be simpler than the ones that had already been suggested
06-15-2011 11:51 AM
On my older machine, AB's comparison method is significantly slower than IR&C (almost twice as slow).
This is comparable to IR&C on my machine:
Max&Min seems to have caught chicken pox.