01-10-2011 08:42 PM
For all typical inputs, all versions are "fast enough", so this exercise is mostly academic.
Unfortunately for me everything i do using LabVIEW is purely academic
01-11-2011 02:06 AM - edited 01-11-2011 02:07 AM
OK, just to wrap this up, here's a quick benchmarking application in LabVIEW 2009 that allows comparing the various algorithms discussed in this thread. It's not very polished, but works OK for as a demo.
As mentioned before, LabVIEW 2010, is a bit faster than 2009. The two images show he results of equivalent runs. Of course there is quite a bit of shot noise due to the small number of milliseconds for the default inputs. We should pick the shortest time for each run.
I am sure a faster algorithm could still be found ... 🙂
Note that my algorithm is fastes for the default inputs. For very sparse arrays, Lucither's code is faster because it can skip empty rows more efficiently.
01-11-2011 02:31 AM
Nice post. I like the use of the in-place element structure. Will have to remember that one.
Rgs,
Lucither.
01-11-2011 10:54 AM
I've been continueing to monitor this thread, and I've learned quite a bit. Thanks you two!
@altenbach wrote:
Note that my algorithm is fastes for the default inputs. For very sparse arrays, Lucither's code is faster because it can skip empty rows more efficiently.
And that's exactly what I need! A happy medium between an array full of 1s and an input array full of 0s.
01-14-2011 02:23 PM
A very interesting thing to note on my W7 64-bit is the following
/Y:
01-14-2011 02:47 PM
Also interesting to note is that if i use In place elements on basically all operations it's actually a little slower, i land at about 1,12.
/Y
01-14-2011 03:42 PM
Yes, if you look at the buffer allocations, you can see that my code is fully "in place", so an in place element structure would not contribute anything new when used as a substitute for "replace array subset".
The in place structure probably does have slightly more overhead, because it does more and also provides the existing element as inner output, which is only needed for the increment operation where I use it. Just guessing....
01-14-2011 03:47 PM
@Yamaeda wrote:
A very interesting thing to note on my W7 64-bit is the following
Oh, I am sure there will be subtle differences based on CPU architecture, cache levels, etc. What is the exact model of your CPU?
01-14-2011 03:59 PM
Since just a couple of months, this rig is a AMD Phenom x6 1090T.
/Y