AlexA Posted December 9, 2009 Report Share Posted December 9, 2009 Hey guys So I'm trying to benchmark a couple of labview algorithms to be able to say something about which is more efficient before I go about trying to expand on that method for my final purpose of image processing. Here's how I've set it up so far. (Attached Image) Depending on how I wire the waveform into the sequence part I can get significant differences in the speeds of each algorithm. The first front panel is the result corresponding to the first block diagram. The second front panel corresponds to the second block diagram. Note the only difference is where I wired the waveform into the sequence. Could someone please explain this phenomenon to me? Also any suggestions for a better way to go about this would be much appreciated. Regards Alex Quote Link to comment
Daklu Posted December 9, 2009 Report Share Posted December 9, 2009 This is a pure guess on my part... I suspect the increased autocorrelation time you are seeing in the first configuration also includes time needed to copy the waveform data. What happens if you cut the waveform size in half? Does the time difference also get cut in half? Quote Link to comment
AlexA Posted December 9, 2009 Author Report Share Posted December 9, 2009 Well I've run that VI for a range of data from 1000 samples in length to 1,000,000. The algorithms are both size dependant, but any differences are obscured by the fact that changing the wiring gives different results, also, in both wiring examples, reversing the order of the VI's in the flat sequence reverses the timing results. I thought I had an idea about how to benchmark this stuff but I'm clearly missing something crucial. Quote Link to comment
AlexA Posted December 9, 2009 Author Report Share Posted December 9, 2009 I think I might genuinely be moderately retarded. I just realised the results swap because they are the same run times but in different fields (which I haven't renamed). I managed to confuse myself into thinking the actual run times were changing. I'm still curious as to why it makes a difference where you wire the wires in though. Quote Link to comment
asbo Posted December 9, 2009 Report Share Posted December 9, 2009 I think I might genuinely be moderately retarded. I just realised the results swap because they are the same run times but in different fields (which I haven't renamed). I managed to confuse myself into thinking the actual run times were changing. I'm still curious as to why it makes a difference where you wire the wires in though. It probably has something to do with the preallocation of memory, these are my theories: If you wire both into the first frame, both arrays are allocated and copied before the first frame executes. If you wire it into a frame in the middle, that frame is responsible for allocating that memory. In your first example, try wiring in the second copy one frame sooner and then wiring it sideways into the case where its needed and see how that affects your timing. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.