From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
MGiacomet

Index Array Performance Optimization

Status: Declined

Not reproducible with debugging disabled

Please improve the performance of 'Index Array" for when the index input is constant.

 

In the attached image (top diagram), the Index Array always resolves to a fixed location in memory (first array element, in this case, but could be any one, if wired a constant index.) The compiler should be able to replace it with the (constant, indexed) address in memory and execute at the same speed as the bottom diagram.

 

NOTE: This is a contrived example only to demonstrate the overhead of Index Array with a constant index. Even if the array being passed were not to be an array of constants, the compiler should still figure out that "Index Array" will always point to the same memory location and minimize the overhead.

 

 

6 Comments
AristosQueue (NI)
NI Employee (retired)

This optimization should already be applied when debugging is turned off on the VI.

Do you have debugging turned off on that VI?

X.
Trusted Enthusiast
Trusted Enthusiast

You should learn how to embbed figures in your posts.

 

See that little button below: that's what you are supposed to use:

 

Screen Shot 2016-02-15 at 17.27.36.png

 

And when you are calling for confirmation, insert a snippet rather than a screenshot (save your snippet as a png):

 

Screen Shot 2016-02-15 at 17.30.46.png

 

You'll get a lot more feedback (from personal experience).

MGiacomet
Member
No, don't have debugging enabled. However, it doesn't make sense to have to disable debugging for the WHOLE VI to avoid being "able" to "debug" something that has noting to be debugger, i.e., the indexing of a fixed array element.
AristosQueue (NI)
NI Employee (retired)

It might not make intuitive sense, but I assure you it makes sense. Optimizations remove chunks of code such that particular wires no longer have their values computed, which would make those wires no longer probeable. So we just do not apply those optimizations while you have deubgging enabled.

 

 

BUT that's a side issue... you're making the claim that this happens even with debugging off. Just to be clear, you went into VI Properties >> Execution and turned off "Allow debugging". After this, you tried both of your benchmarks and you still saw a problem. Yes? 

AristosQueue (NI)
NI Employee (retired)

With debugging disabled, I cannot replicate your claims.

 

By the way, your test VIs are using the Tick Count primitives. Don't use those for precision timing. Use "High Resolution Relative Seconds.vi" in its place.

Darren
Proven Zealot
Status changed to: Declined

Not reproducible with debugging disabled