10-22-2013 03:43 PM - edited 10-22-2013 03:43 PM
There must still be something funky with mine. On the first run yours does beat mine by a considerable amount. But the runs after are interesting where sometimes yours is faster sometimes mine is.
I also noticed that if the TRUE to FALSE ratio was more even yours generally did better then mine (by a few ms in a 10M size array) but if there were less transitions from TRUE to FALSE mine generally did better (again by a few ms). I'm guessing because as I mentioned my loop doesn't run for as many elements in the array but instead runs for every transition so the fewer transitions the fewer loops on mine but yours will always be the size of the array. I wonder if preallocating the array would have helped mine any more. In either case this was a fun exercise, and likely beyond whatever the original poster was looking for.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-22-2013 03:56 PM - edited 10-22-2013 03:57 PM
I did't expect to go for speed on large datasets.
Here is another...
The search array is suprisingly fast.
10-22-2013 04:23 PM
@WillD wrote:
I did't expect to go for speed on large datasets.
Here is another...
The search array is suprisingly fast.
This one is almost within benchmark noise the speed of mine (in the longterm average, mine still wins by a few % on my rig) 😉
(OTOH, I think yours has some slack left here and there :o, maybe mine too...)
Search is better if there are only very few transitions, because it needs to loop less. However, even search needs to inspect every element one way or another, but it might be more optimized for SSE, for example.
10-22-2013 04:32 PM - edited 10-22-2013 04:36 PM
On my rig mine beats your previous posted one, very minimally, like ~0.4%. I think the search is quite optimized, it smokes my bit-bashing attempt that I expected would be faster.
10-23-2013 12:17 AM
Thanks to everybody. I have tried each program it works fine. When I run Hooovahh program I am getting some delay due to the higher input of N terminal. I reduced to 10000. Now it executes fine.
Regards
Gokul