LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is In place structure really help in run time.

Hello All,

 

I have complex data structure like array of cluster inside cluster again array of cluster. 

 

I have used in place element structure and also normal unbundle and bundle but I have not seen any improvement in the speed. 

 

Can anybody help to understand about the info of in place structure node.

0 Kudos
Message 1 of 12
(3,148 Views)

The compiler will often spot an unbundle - something - bundle as being essentially an in-place operation and will kind of do the IPE for you.  There are cases, however (like increasing code complexity causing the recognition of such code patterns to be unavailable) where this automatic inplaceness can fail.

 

In such cases, in order to tell the compile explicitly that you want it done in-place, the IPE may help.  For all other cases, NI recommends you simply unbundle - bundle and let the compiler do the rest.

Message 2 of 12
(3,144 Views)

To be in save position every time, it  will better to have in place structure node every time? Or simple unbundle and bundle?

0 Kudos
Message 3 of 12
(3,139 Views)

If you want to be really NI-conform then unbundle-bundle.

 

I've been burnt by that in the past (above-mentioned complexity issue) so that when I have time-critical code I put an IPE in the code to make sure there's no mistakes.

0 Kudos
Message 4 of 12
(3,132 Views)

@LV_COder wrote:

 

I have complex data structure like array of cluster inside cluster again array of cluster. 

 


Is your data structure fixed size on all levels?

Do you see buffer allocations dots?

 


@LV_COder wrote:

 

I have used in place element structure and also normal unbundle and bundle but I have not seen any improvement in the speed. 

 


The LabVIEW compiler is very good determining what can be done "in place" and will often find an equivalent solution even if you don't use the IPE structure. (EDIT: Intaris already said that ;))

 

How do you measure speed? It is possible that you benchmark is flawed.

0 Kudos
Message 5 of 12
(3,122 Views)

Actually I am doing fm generation in real time and due to some computation in run time I am not getting continuous output, very little break is there in between the generation. When used normal unbundle and bundle node.

 

So the same code I have tried to put in the place structure node. This is how only I was guessing the speed (not a good way to comment on the speed )as i have got the same results as it was there in normal bundle and unbundle.

 

0 Kudos
Message 6 of 12
(3,094 Views)

Your description of the problem is still way too generic to give any real advice. Maybe it is even possible to pick more efficient data structures (and code architecture!) from the beginning.

 

Can you attach some simplified sample code showing the data structures and typical operations?

0 Kudos
Message 7 of 12
(3,087 Views)

@LV_COder wrote:

Hello All,

 

I have complex data structure like array of cluster inside cluster again array of cluster. 

 

I have used in place element structure and also normal unbundle and bundle but I have not seen any improvement in the speed. 

 

Can anybody help to understand about the info of in place structure node.


Intaris and Altenbach already mentioned the possible compiler optimizer limitations due to code complexity.     

This code demonstrates the "Magic Pattern,"  that LabVIEW 2010 and later MAY optimize to operate in-place with a minor performance improvement over using an IPE

Capture.png 

in 2009 that would need a IPE to operate in-place. in 8.6 and earlier the IPE is unavailable.

 

OK that handles the IPE question but, I am guessing what you really meant to ask is "How do I fix my Real-Time FM generation vi so that the output is contiguous?" 

 

Without seeing your data cluster and the FM signal generation vi that uses it we can only give general advice.  So, let's see some code.

 

 


"Should be" isn't "Is" -Jay
Message 8 of 12
(3,082 Views)

And for completeness,

 

You can always read the vi property "Compiled:LastCompiledWith" To determine if you may need to use the IPE.  If the value is "Full Compiler Optomizations" the Magic pattern was seen and the IPE is not needed to make the "Un-bundle - Bundle" operation behave in-place


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 12
(3,046 Views)

And for completeness,

 

You can always read the vi property "Compiled:LastCompiledWith" To determine if you may need to use the IPE.  If the value is "Full Compiler Optomizations" the Magic pattern was seen and the IPE is not needed to make the "Un-bundle - Bundle" operation behave in-place.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 12
(3,046 Views)