09-07-2005 10:13 AM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-07-2005 11:19 AM
How about posting it?
You know we do much better when we have what to play with.
As a wild guess, based on the description, maybe the fact that the reference is out of the loop forces LV to do more work because a reference isn't just a wire with data, but actually requires that the control be updated. Maybe when the reference is outside the loop, LV doesn't check to see if the wire is split and if the ref is used elsewhere (or something)?
Post the code...
09-07-2005 02:11 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-07-2005 02:25 PM
It seems that using an explicitly linked property node is the same as placing the property outside the loop.
My guess would still be that because the reference itself is out of the loop, LV probably does some additional checking or something in every iteration, but that is really based on no facts.
09-07-2005 02:51 PM
But I could understand that. If it took LONGER when the reference was INSIDE the loop, I could say that LV is checking the validity of something. That's why I expected the result to be slightly SHORTER when I moved it outside - it would perform the check ONCE and then just USE it.
But it's the other way around - it takes LONGER when it only does it ONCE !!!
Why is that?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-07-2005 02:58 PM
09-07-2005 03:48 PM
I see. I misunderstood your previous post.
That sounds like a reasonable explanation, if you assume that checking a reference's validity is a lengthy operation. And apparently it's way more lengthy on OS X.
From what I've seen, any operation with references or property nodes is quite time-consuming.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-07-2005 03:57 PM
I am leaning towards tst's explaination.
LV appears to leave out something when the reference is inside the loop. If you compare the code size for the two versions, the inside is 4.9K and the outside version is 5.1K.
That 200 bytes seems to make a big difference. I wonder if a validity check can be done with only 200 bytes of code. I suspect some type of optimization, maybe "folding"?
Ben
09-07-2005 03:57 PM - edited 09-07-2005 03:57 PM
I am leaning towards tst's explaination.
LV appears to leave out something when the reference is inside the loop. If you compare the code size for the two versions, the inside is 4.9K and the outside version is 5.1K.
That 200 bytes seems to make a big difference. I wonder if a validity check can be done with only 200 bytes of code. I suspect some type of optimization, maybe "folding"?
Ben
Message Edited by Ben on 09-07-2005 03:59 PM
09-07-2005 04:14 PM