Slow response using Data List Viewer

I have two questions about List Viewer and Data List Viewer.

I have been working on an app that takes a user input, performs some calculations and produces two lists (“fruit”; “amount”). The list can be sorted by amount (high to low, or low to high) or alphabetically. This is all working nicely. The issue is how to display these quickly and neatly.

I want to show the results in two neat columns (fruit | amount). If I use List Viewer, the results are produced very quickly but they do not look very nice. I can’t get two neat columns. This is because I create a list in the list viewer which adds two text properties together. The string for fruit varies in length and so the ‘amounts’ are not neatly aligned in List Viewer.

So instead, I took the two lists and put them in two columns in a Data Source. Data List Viewer then pulls the data from each column and it looks great. The problem is that when the user presses an icon to perform a calculation, it is painfully slow. The lag is about a second. That may not seem like much but it completely unworkable for my project.

So my questions are:

(1) is there a workaround to make the List Viewer display two neat columns, similar to Data List Viewer? I have tried two separate lists side-by-side, but then they scroll individually, and so that solution does not work). I also tried using text align, but this does not allow two items of text in the same string to be aligned differently in a single line. Would it be possible to have two overlapping lists (one for fruit, one for amount) in the new project layout???

(2) Is there anything I can do to reduce or eliminate the lag with using Data Source and Data Viewer?

Any help very much appreciated!

1 Like

Thank you for including so much helpful detail!

Could you also share the blocks you are using to populate the data list viewer?

Hi drted - here are the relevant blocks.

The screen2 starts block does the following:

  • delete all rows in the data source RESULTS so that it doesn’t get longer and longer.
  • set a list variable (UNSORTED_LIST) with 2 properties (inst = fruit; amount is the amount that will ultimately be sorted).
  • put the two properties into 2 different lists
  • put the two lists into two rows in the Data Source RESULTS

[this is to set up an initial Data Source RESULTS table]

The compile_unsorted_list block does the following:

  • for the list variable UNSORTED_LIST, the calculated values are now inserted into the ‘amount’ property.

The display_SORTED_list block does the following:

  • the input for this block is the UNSORTED_LIST, which has now been sorted by another block
  • the two properties of the UNSORTED_LIST are separated into two lists
  • the two lists are entered into the data source RESULTS

For the List Viewer version, the two properties of the sorted UNSORTED_LIST are added to a sorted_list which joins up the two properties as text items. Therefore the ‘screen2 starts’ block is not necessary (I just set the sorted_list to empty).

Not sure if that is makes sense?

I haven’t used the update row blocks. What happen if instead of updating each row in RESULTS, you delete all rows, then recreate each row like in the start event? Is it any faster?

Here is how I did it and it is very fast JSON Bound Data List Viewer - No More Cloning!

Thanks - let me try that and I’ll report back.

Hi drted - so I tried using ‘create row’ instead of update and there is no improvement unfortunately. I am puzzled why calling the data source is so much slower. When I use list viewer the list updates immediately.

@slothball,

That is a tough one. The only other thing I can think of is to measure the time of each and every step to see exactly where the slow point is (loops, add, etc.). Perhaps that will point to how to optimize the display. Something like this

Great idea - I will try this. Thanks again.