LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Explain timing anomalies with references

Once again, wild guess, again based on the fact\assumption that a reference is different from standard wires with values. Let's say the optimization works in such in way that if the compiler detects the reference inside the loop, it moves the entire loop into the UI thread, but if it isn't inside the loop, it doesn't, and then it has to do thread switching whenever accessing the property node, which would increase the time. If this is so, this is probably simply an oversight in optimization (or maybe they had some deeper thought).

___________________
Try to take over the world!
0 Kudos
Message 21 of 24
(646 Views)


....but if it isn't inside the loop, [snip...] which would increase the time...


It looks like (in my warped corner of space-time), when running in UI mode:

With reference Outside the loop, tested code runs about 5% Faster  ( => Slower when reference is Inside loop. )

Perhaps intial results reflected mis-interpretation of "noise" - compiler sensitivity to "Execution System"?

cheers

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 22 of 24
(633 Views)
Once again, wild guess, again based on the fact\assumption that a reference is different from standard wires with values.
--- I personally doubt that, simply because you can do so many things the same as other values - wire them, connect via front panel terminals, make arrays, etc. It's probably just another 32bit number that the compiler knows is a refnum to a control.


But, for the sake of argument, let's assume you're right.

Let's say the optimization works in such in way that if the compiler detects the reference inside the loop, it moves the entire loop into the UI thread, but if it isn't inside the loop, it doesn't, and then it has to do thread switching whenever accessing the property node, which would increase the time.

--- Well, assuming your item 1 is correct, that would make sense EXCEPT for the fact that the SEQUENCE changes the results. I can't see a reason the (empty) SEQUENCE would force it into another thread.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 23 of 24
(626 Views)
Perhaps intial results reflected mis-interpretation of "noise" - compiler sensitivity to "Execution System"?


I'm not sure whose results you are referring to (this message board really needs work to clarify who's responding to whom), but notice this: when I run on OS X, the numbers go from 480+ uSec down to 14 or so.


that means two things:
1... Whatever they're doing to implement the ExecSys is WAY more of a burden on OS X than on Windows.
2... No way at all that that is "mis-interpretation of noise". I understand what you mean, but the timing thing runs lots of cases to reduce that, and it's hard to mistake 480 for 14.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 24 of 24
(625 Views)