LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tables where the Active Cell:Cell Size:Height is set are slow to scroll?

Solved!
Go to solution

Dear all!

 

I am still working on table elements and recently found that one of my larger tables has bed performance when scrolling. Depending on the target system, scolling below line 2000 becomes sluggish and above line 4000, the update rate drops close to 1Hz. I have now found that the most likely culprit is the Cell height.

 

I made a benchmark where I used the table index as a substitute for scrolling. When the height of an appreciable number of cells is not the default height for the default text size of the table (i.e., the one set for cell [-2, -2]), scrolling takes longer, the farhter down the table is already scrolled. There seems to be a linear relationship between the number of "irregular" cell heights. It does not depend on the cause of the cell height shift. It happens when

  • setting the font size or
  • cell height directly, or
  • causing the text to be displayed in more than one line.

When no cells have irregular heights, scrolling takes constant runtime.

 

I have attached my benchmark VI. Please note that on LabVIEW 16, programmatically setting "Autosize Row Height" seems to work unreliably, sometimes resetting to data already present, sometimes resetting on new data, sometimes doing neither. I have not done more research on this.

 

Am I correct in my assessment? If Yes, is there a way to deal with it when I really want to set a large number of row sizes differently?

 

Best,

Leo

 

PS: This post is also somewhat related to my previous posts dealing with tables:

 

https://forums.ni.com/t5/LabVIEW/Change-background-color-of-a-table-based-on-table-cell-values/m-p/4...

https://forums.ni.com/t5/LabVIEW/Cell-Justification-Property-for-the-whole-table-not-setting/m-p/407...

 

0 Kudos
Message 1 of 8
(2,746 Views)

@LLindenbauer wrote:

Am I correct in my assessment? If Yes, is there a way to deal with it when I really want to set a large number of row sizes differently?


Why do you need scrolling to be (really) fast?

 

Is it so slow that it stops user interaction? If you're automatically updating, and if that's too slow, I'd perform the update in a 2nd loop. Send the updates in a 1 element queue and lossy enqueue the updates. That will only execute the last update...

0 Kudos
Message 2 of 8
(2,693 Views)

wiebe@CARYA wrote:

@LLindenbauer wrote:

Am I correct in my assessment? If Yes, is there a way to deal with it when I really want to set a large number of row sizes differently?


Why do you need scrolling to be (really) fast?

In essence: Because it is a requirement. Even if it were not, the user experience is noticeably degraded when one perceive the program to be struggling to just show the next line in a table. In deployed code, scrolling one tick takes upwards to a second. I would not appreciate a spreadsheet program taking this long when the content is not complex.

 

Is it so slow that it stops user interaction? If you're automatically updating, and if that's too slow, I'd perform the update in a 2nd loop. Send the updates in a 1 element queue and lossy enqueue the updates. That will only execute the last update...


I already have such a setup in my main application for exactly that reason. In this sense, blocking the GUI is not the primary issue, but the immediacy of visual feedback. The slow scrolling is also present in the editor when the VI is not running. The issue is within the table itself, not the code running around it - it's just easier to quantify that way.

 

When no line heights are changed, scrolling through the table takes constant time

LLindenbauer_0-1605694605220.png

but the scaling is linear when some (or all) lines are formatted

LLindenbauer_1-1605695126174.png

 

This is my benchmark on the development machine. At the bottom of the table, scrolling takes place at about 7 fps. In production, it is much slower than that.

0 Kudos
Message 3 of 8
(2,689 Views)

As an aside, something that I just stumbled upon while testing:

 

When setting the row height for [-2, -2] and then manually, in the editor, changing the height of specific rows, these rows will keep their height, even when running the code to set the row height for [-2, -2] again - except when the [-2, -2] height was changed to some other value in between. I believe that this behaviour is not entirely covered by the manual.

 

RowResize.png

Message 4 of 8
(2,684 Views)
Solution
Accepted by topic author LLindenbauer

I guess you're lucky to get linear increment. Often the listbox shows exponential increment 😁.

 

I think I'd try to make a dummy listbox and scrollbar. Then catch the scrollbar events, calculate what needs to be in the listbox, and put it there starting at 0,0.. When done right, I think this will appear to the user as if (s)he's scrolling through the data.

 

Updates might be slow, but at least it will be constant. Question is if it's fast enough...

0 Kudos
Message 5 of 8
(2,667 Views)

wiebe@CARYA wrote:

I guess you're lucky to get linear increment. Often the listbox shows exponential increment 😁.

Maybe I am. 🙂

 

I think I'd try to make a dummy listbox and scrollbar. Then catch the scrollbar events, calculate what needs to be in the listbox, and put it there starting at 0,0.. When done right, I think this will appear to the user as if (s)he's scrolling through the data.

 

Updates might be slow, but at least it will be constant. Question is if it's fast enough...


I experimented with this for a bit and it seems promising. I used a table with two "viewports" where I would switch between them, to avoid having to delay the frontpanel redraw. The delay due to the amount of formatting necessary was still too much, but further tweaking might get it done.

 

I also managed to find the correct settings to get the constant scrolling that I wanted: The solution was to disable the automatic height adjustment and just set the height once for the whole table.

 

If I may ask: What would be an advantage of using the listbox over a table? When would one choose one over the other?

0 Kudos
Message 6 of 8
(2,643 Views)

@LLindenbauer wrote:

If I may ask: What would be an advantage of using the listbox over a table? When would one choose one over the other?


I didn't gave that much though.

 

They're just different, most notably the values.  A table as the strings as value, a listbox the selected value(s).

 

IIRC, all problems with (non-linear) slow updating apply to both.

 

If the user can edit the values, a table makes more sense. Although even for a table it's hard tune the UX, so eventually neither a listbox nor a table work well 😊.

0 Kudos
Message 7 of 8
(2,636 Views)

@LLindenbauer wrote:

If I may ask: What would be an advantage of using the listbox over a table? When would one choose one over the other?


If you need to consistently update the values, for example a table of statistical results with each acquisition, etc, then use a table control/indicator. The listbox would need to update its string values through a properties node which is generally slower.

 

The listbox is useful is you want an icon in your table, there is even a hack to get icons in all the cells in a listbox. Listbox is closely related to a tree control, that might help or not differentiate the listbox from the table.

 

mcduff

0 Kudos
Message 8 of 8
(2,620 Views)