LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance of state machine with enum vs string?

Indeed I am surprised with debugging disabled!  Both cases now clock in at exactly 15.6ms to run the entire VI -- I had to use the Profiler to get any numbers back at all since disabled debugging produced much faster performance.  Additionally, I bumped up the iterations to 2E9.  So the 15.6ms is for 10x 2E9 iterations, and it is 15.6ms for both string and enum selectors, which is odd.  Perhaps this is the minimum measurable execution time for this scenario.  Another possibility is that the no-debug optimization sees no code inside the case structures and simply optimizes it out.  I think the next test is to include identical non-optimizable code inside each case to ensure code is not optimized out.  The plot thickens...

0 Kudos
Message 41 of 46
(855 Views)

🙂   Just saw your post after I was theorizing that the code is being optimized out...good to get confirmation from your input about code folding!  Thank you!

0 Kudos
Message 42 of 46
(855 Views)

Using Sir Crossrulz's suggestion, wire output to a control, I used last value and did not wire all cases, I did not see a big difference between the two cases.

 

Mmm, where is Altenbach, he is the Knight of Benchmarking??

 

mcduff

0 Kudos
Message 43 of 46
(850 Views)

For a random integer array without dup's use riffle vi riffled index out. With an array size in equal to the desired values. Who cares what the array element values are the indexes out will be 0  - n-1 in a gaussian distribution.

 

Also try hires rel seconds for better snr on timing.

 

Nice work


"Should be" isn't "Is" -Jay
0 Kudos
Message 44 of 46
(822 Views)

@JÞB wrote:

For a random integer array without dup's use riffle vi riffled index out. With an array size in equal to the desired values. Who cares what the array element values are the indexes out will be 0  - n-1 in a gaussian distribution.

 


First, I picked up on "Gaussian Distribution" (also known as the Normal Distribution) -- did you mean Uniform Distribution?  Then I tried to figure out what you meant as the algorithm, and figured it out, but, boy, how arcane!

 

Bob "Picky" Schor

0 Kudos
Message 45 of 46
(813 Views)

@Bob_Schor wrote:

@JÞB wrote:

For a random integer array without dup's use riffle vi riffled index out. With an array size in equal to the desired values. Who cares what the array element values are the indexes out will be 0  - n-1 in a gaussian distribution.

 


First, I picked up on "Gaussian Distribution" (also known as the Normal Distribution) -- did you mean Uniform Distribution?  Then I tried to figure out what you meant as the algorithm, and figured it out, but, boy, how arcane!

 

Bob "Picky" Schor

 

Sometimes I learn a thing or two about here.  Dr. K tipped me off a while ago.  Too bad he is not able to keep up with us.



"Should be" isn't "Is" -Jay
0 Kudos
Message 46 of 46
(807 Views)