cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

FOR loop + Case structure to accommodate indicators in small space - performance?

Solved!
Go to solution

FOR loop + Case structure to accommodate indicators in small space - performance?

In a particular case I just used a simple FOR loop and a Case structure to accommodate many indicators to save BD space (42 indicators...I swear, this number is accidental! Smiley Very Happy ).

I know I should use clusters to group up indicators (in this case this was not an option due to special GUI reasons), or to use SubPanels loaded with display VIs (neither was a comfortable option).

 

Anyway, my actual question regards to performance of such (not really elegant) constructions during runtime: distributing many indicators into such structures impact the runtime performance? If so, should I enable loop iteration parallelism? Would it make any difference?

Extra info: the loop where this construct is placed, iterated with a slow speed of 1 Hz.

 

many_indicators.png

0 Kudos
Message 1 of 19
(794 Views)
Solution
Accepted by topic author Blokk
01-05-2018 08:53 AM

Re: FOR loop + Case structure to accommodate indicators in small space - performance?

As long as those indicators are NOT set as "Syncronous" I suspect it will not make much of a difference.

 

Going even farther...

 

Since they only get updated 1/second you would most likely be able to update those indicators using control references in a sub-VI... unless your UI Thread is already over-loaded.

 

Ben

Message 2 of 19
(777 Views)
Solution
Accepted by topic author Blokk
01-05-2018 08:53 AM

Re: FOR loop + Case structure to accommodate indicators in small space - performance?


Blokk wrote:

Anyway, my actual question regards to performance of such (not really elegant) constructions during runtime: distributing many indicators into such structures impact the runtime performance? If so, should I enable loop iteration parallelism? Would it make any difference?


It will affect performance.  Enough for you to care?  Probably not.  Will parallelism help?  Try it an see.  My guess is not.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 3 of 19
(773 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?


@crossrulz wrote:

Blokk wrote:

Anyway, my actual question regards to performance of such (not really elegant) constructions during runtime: distributing many indicators into such structures impact the runtime performance? If so, should I enable loop iteration parallelism? Would it make any difference?


It will affect performance.  Enough for you to care?  Probably not.  Will parallelism help?  Try it an see.  My guess is not.


I suspect we would have a very difficult time even measuring a difference in performance between doing it in a For loop or not.

 

It becomes a philosophical question;

 

"If a code change impacts performance but there is no way to measure the impact, ...?"

 

Ben 

0 Kudos
Message 4 of 19
(753 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?

Have you ever had guys a feeling like "....hmm, I might ASKED THIS BEFORE???" Smiley Very Happy

Voalá: https://forums.ni.com/t5/LabVIEW/Make-BD-space-for-indicators-trick-FOR-loop-Case-structure-combo/m-...

 

Does this mean I am getting older?

Smiley Very Happy

 

edit: ok, to be fair with myself, I asked about alternatives in that summer post, and here I asked about performance Smiley Happy

0 Kudos
Message 5 of 19
(741 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?

The broken wires distract a little bit. So is this only one big cluster or several small clusters that you unbundle in the various cases?

 

I agree with Ben that you won't notice an impact, these are just scalars. Updating the UI thread is asynchronous anyway.

 

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

 

Personally, I would also move the terminal labels to the right and stack the terminals nicely without wire bends, but that's just me. Smiley Very Happy

 

 


LabVIEW Champion Do more with less code and in less time
Message 6 of 19
(737 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?


@altenbach wrote:

The broken wires distract a little bit. So is this only one big cluster or several small clusters that you unbundle in the various cases?

Yes, several smaller ones.

I agree with Ben that you won't notice an impact, these are just scalars. Updating the UI thread is asynchronous anyway.

Ok.

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

Hmm, sounds reasonable!

Personally, I would also move the terminal labels to the right and stack the terminals nicely without wire bends, but that's just me. Smiley Very Happy

This was a kind of "fight back" against my OCD Smiley Very Happy

 


 

0 Kudos
Message 7 of 19
(733 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?


@altenbach wrote:

 

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

 


This triggered an idea for a new structure, the "parallel stack". It would look like a stacked sequence, but would simply instruct the compiler to do all frames in no particular order and as parallel as possible. Smiley Very Happy It would be just a cosmetic diagram organization tool and would be treated as if all frames were flattened out to the diagram. Smiley Very Happy Hmmm....

 

Frames could be freely named according to function and clicking would expose a pulldown with all frame names for direct access.


LabVIEW Champion Do more with less code and in less time
Message 8 of 19
(722 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?


@Blokk wrote:

...

Does this mean I am getting older?

Smiley Very Happy

...


Well since you asked, I do have a theory...

 

 

Spoiler

After watching my son grow-up and now entertain G-daughters weekly I have found that people will forget what they do or say... otherwise "de jevu" would not be part of our vocabulary.

 

When infants the world is new and wonderful and full of learning experiences. I watched my son's eye light up when he was an infant, wildly waving his arms around and after smacking himself in the face, he looked at his hand and it seemed he was thinking "Wow, I think I just did that!"

 

The interest in new things can then decline and about 8-9 years old the phrase "I'm bored!" is uttered.

 

As we get older we start to create lists of things we plan to do some day..

 

As time passes we keep adding to that list and our spare time is spent doing some of those things.

 

Eventually we get to a point where we recognize "I have more things on my list than I have time left in this life!"

 

That is getting close to being old but you eventually have to give up, admit you are getting old and you let you better-half prioritize the list for you.

 

 

 

And just for the record, I am old!

 

Ben

Message 9 of 19
(717 Views)

Re: FOR loop + Case structure to accommodate indicators in small space - performance?


@altenbach wrote:

@altenbach wrote:

 

However, this is one of the rare cases where a stacked sequence would actually be a better alternative (only inputs, no outputs or sequence locals). I would probably use that! same functionality!

 


This triggered an idea for a new structure, the "parallel stack". It would look like a stacked sequence, but would simply instruct the compiler to do all frames in no particular order and as parallel as possible. Smiley Very Happy It would be just a cosmetic diagram organization tool and would be treated as if all frames were flattened out to the diagram. Smiley Very Happy Hmmm....


If you put this on the idea exchange, i will vote for it! Smiley Happy

0 Kudos
Message 10 of 19
(710 Views)