LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer - Consumer/Producer - Consumer for improved performance?

Solved!
Go to solution

Not sure this helps the Variant overhead, as a variant is, I believe, a description of the data plus a pointer to the data.  There's no copying of large data required, so your DVR in a Variant is just as big as a giant array in a Variant.

 

So far in my cases, according to the Windows Task Manager and various LabVIEW profiling tools, the variant just contains the reference which I believe is a U32 number. Similar to type-casting the reference and then send a U32 around.

 

mcduff

0 Kudos
Message 21 of 25
(720 Views)

And a pointer to a giant array is also a 32-bit number.  "Moving" data only involves a 32-bit pointer unless the compiler believes a copy needs to be made.  You should be worrying about copies, not variants.

0 Kudos
Message 22 of 25
(712 Views)

Sorry I wasn’t clear in the last post. I was trying to say in my experience if you take a dvr reference and cast it into a variant the compiler does not copy the associated data with the dvr, on the 32 bit reference number.

 

mcduff

0 Kudos
Message 23 of 25
(705 Views)

@mcduff wrote:

Not sure this helps the Variant overhead, as a variant is, I believe, a description of the data plus a pointer to the data.  There's no copying of large data required, so your DVR in a Variant is just as big as a giant array in a Variant.

 

So far in my cases, according to the Windows Task Manager and various LabVIEW profiling tools, the variant just contains the reference which I believe is a U32 number. Similar to type-casting the reference and then send a U32 around.


Moving will just move a pointer. A copy is expensive.

 

The mere overhead of the to\from variant can add up. I won't be too worried about that until it proves to be a problem.

 

The biggest problem with variants is that you get run time errors, while you really want compile time errors.

0 Kudos
Message 24 of 25
(688 Views)

 wrote:

The biggest problem with variants is that you get run time errors, while you really want compile time errors.


@mcduff, please add bad readability of the code in your list of biggest problems with variants.

 

In some cases variants are the best. However I did not see many of such cases.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 25 of 25
(678 Views)