LabVIEW Idea Exchange

About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
Top Authors
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

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
Proven Zealot

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

Do you have debugging turned off on that VI?

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).

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.
Proven Zealot

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? 

Proven Zealot

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.

Proven Zealot
Status changed to: Declined

Not reproducible with debugging disabled

DNatt, NI