09-22-2020 12:59 PM
@Karan_jasani wrote:
Hi,
Please find attached VI where input array is having default values.
The output is correct but takes around 5 minutes.
2.5 minutes for me.
I'm looking forward to see how much Altenbach reduces it.
09-22-2020 01:03 PM
@RavensFan wrote:
@Karan_jasani wrote:
Hi,
Please find attached VI where input array is having default values.
The output is correct but takes around 5 minutes.
2.5 minutes for me.
I'm looking forward to see how much Altenbach reduces it.
I'm betting two primitives and an auto-indexed FOR loop. 😉
09-22-2020 01:06 PM - edited 09-22-2020 01:06 PM
@RavensFan wrote:2.5 minutes for me.
I'm looking forward to see how much Altenbach reduces it.
I got it down to 284.9ms...
09-22-2020 01:50 PM
@crossrulz wrote:
I got it down to 284.9ms...
Mine was pretty similar but I have the gut feeling that it can be optimized further. 😉
09-22-2020 02:03 PM - edited 09-22-2020 02:04 PM
@altenbach wrote:
@crossrulz wrote:
I got it down to 284.9ms...
Mine was pretty similar but I have the gut feeling that it can be optimized further. 😉
Yep, I've been playing some more. Preallocating the array and not reshaping seems to help quite a bit. My Profile Performance and Memory is showing an average of 103.4ms. Though, this is starting to look a little messy.
09-22-2020 02:24 PM - edited 09-22-2020 02:27 PM
Here's my version. I am on an old laptop. Will test on a more powerful machine later.
It would be curious if pre-allocating the output array would make any difference. The compiler should be smart enough to figure out the final size. 😉
(And yes, we only need to mask the lower trace, of course. Not shown)
09-22-2020 02:26 PM - edited 09-22-2020 02:35 PM
09-22-2020 02:28 PM - edited 09-22-2020 02:34 PM
09-22-2020 02:38 PM - edited 09-22-2020 02:44 PM
Another version (~33ms)....
Parallelization helps slightly, bringing it down to ~22ms. Probably not worth the extra overhead:
09-22-2020 02:39 PM - edited 09-22-2020 02:39 PM