This is my revised version.
# elements, current array filter, mine implementation array filter
10000 - 30 ms - 0 ms
100000 - 2154 ms - 5 ms
1000000 - after 7 minuts it was still running - 56 ms
wgtk_filterArray.vi 14.5K 64 downloads
The only difference is that I do not remove duplicates from the "items to filter". Further in this implementation the "filtered items indices" are returned sorted. Also the code could (theoratically) be even faster by first sorting the "items to filter" and then use a binary search instead of the labview linear search.
-edit- small improvement, the second loop iterator for indexing the "filtered items indices" array wasn't necessary. Because it can be calculated by substracting the loop iterator by the iterator for the other array.
wgtk_filterArray.vi 14.29K 54 downloads
Edited by Wouter, 26 July 2012 - 01:03 PM.