LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enable inline subvi property.

Solved!
Go to solution

Is it good to enable the subvi inline property to achieve better run time performance of the VI.

 

Is this property really impact the run time performance of the VI?

 

 

0 Kudos
Message 1 of 6
(2,831 Views)

Typically it makes no difference unless the subVI only contains relatively small amounts of code and is placed in a tight loop.

 

It is not a good idea to have large hierarchies of inlined code inside inlined code because it requires significantly more effort to compile. (The cyclomatic complexity might go through the roof because the entire inlined code hierarchy is flattened to the caller diagram behind the scenes!)

0 Kudos
Message 2 of 6
(2,821 Views)

If you do a simple test VI you'll see the cost of a function call is a few ns, in most cases this is negligable, but in a small VI it could be bigger than the actual code execution.

So yes, it impacts run time performance, if it's good depends on the circumstances.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 6
(2,802 Views)

Yes as others have said it is usually good for functions that are small, and called often (or can be called often).  Good examples are things you might find in a small resuse library, like many OpenG functions (which aren't inlined BTW).  The benefit you see will often be very small, and the downside is debugging will be turned off, meaning no probes/breakpoints, and it is reentrant so seeing the front panel controls will be difficult.  Which is also a good reason to apply inlineing only to small reuse functions that have been tested, and don't expect debugging to be needed.

0 Kudos
Message 4 of 6
(2,783 Views)

@LV_COder wrote:

Is it good to enable the subvi inline property to achieve better run time performance of the VI.

 

Is this property really impact the run time performance of the VI?

 

 


The funny thing is, if you can't answer that question yourself, you probably don't need to worry about it.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(2,777 Views)
Solution
Accepted by topic author LV_COder

Hemant_LV wrote:

Is this property really impact the run time performance of the VI?


Yes. It saves a call (with I doubt is ever significant) but more importantly, it might prevent data copies.

 


@LV_COder wrote:

Is it good to enable the subvi inline property to achieve better run time performance of the VI. 


Optimise when needed, not because you can.

 

Obviously, it's good to make your code keeping efficiency in mind. But inlining comes at a cost. It complicates debugging, slows down compilation, increases executable size, and can cause some weird updating problems in recursive class hierarchies.

 

A "mild version" of inlining is re-entrancy. This is something completely different, but when the VI takes some time, it might increase execution when parallel callers access the VI. It's also a bit harder to debug then a normal VI, but not as hard as an inlined VI. So when inlining is not recommended (when the VI is not trivial), re-entrancy might work.

0 Kudos
Message 6 of 6
(2,753 Views)