ā05-02-2013 03:22 AM
I ran into something unexpected this week when benchmarking some RT code in LV 2012 SP1.
We're currently porting code from essentially 8.5 via 2011 to 2012 SP1. I started changing the sub-vi calls in a timed loop on the RT system from subroutine to inlined with pre-allocated clones. In doing this I had changed the VIs to inlined but forgot to change the subroutine setting. In this configuration the executaion was SLOWER than with just subroutine set. Removing the subroutine setting made the code faster than originally.
My initial thought was "Why on earth does the subroutine setting have an effect on inlined code"?
Can anyone comment on this?
Shane
ā05-02-2013 03:48 AM
Well, the subroutine could be defined within programs, or separately in libraries that can be used by multiple programs. And since the Inline function, whenever used, calls the entire body of the function, the Inline has be hence called from all libraries. If they are used by multiple programs, this could possibily make your execution slower.
ā05-02-2013
06:14 AM
- last edited on
ā04-30-2025
10:25 PM
by
Content Cleaner
When you set a VI to Inlined LabVIEW ignores the execution priority, so it shouldn't have mattered that the priority was left on subroutine (link). The fact that it did matter is very odd. Is this performance degradation behaviour repeatable?
ā05-02-2013 09:35 AM
I saw the difference two days ago. I'm just getting back into testing so I'll try it again and report back.
It seemed pretty repeatable at the time.
Shane.
ā05-02-2013 10:06 AM
Was it just a little bit slower or a lot? Did you force a recompile a couple of times to see if the problem is repeatable?
If you inline code, you increase the complexity of the calling diagram and thus might hit a compile threshold earlier. This would result in less optimization. Just a wild guess.
ā05-02-2013 10:24 AM
The weird thing was when I set the execution back from subroutine, it ran faster again (still inlined).
Just writing this, I might have an idea as to what I really saw. I'll test it tomorrow.
Shane.