Slow array count - how to improve?

Hi all,

I have a repeat, and a checkbox for each item in the repeat. I also have a ‘all’ type checkbox, that when checked, checks the remaining checkboxes in the repeat. Adjacent to this, I have the number of items selected.

E.g. if there are 20 in the repeat list, and I check the ‘check-all’ checkbox, then the count will say 20.

What happens which isn’t great UX is that the count counts up visually, intead of just turning from 0 to 20.

And often, it might take anywhere from 1 to 5 seconds to count from 0 to 20.

Any ideas team how I can improve UX and performance of this? @patrick you initially helped me out with the checkbox clear, so wondered if you have any ideas here?

Most likely a result of too much dynamic stuff on the page. DMX is reaching its limits on the page.
But, I could be wrong.
Sharing your page would be the best way for the team to debug this.

1 Like

Is there a way to check a limit on the page with some dmx console commands? I can work to try and reduce some dynamic data - but while the page content is quite large there isn’t a huge amount of dynamic data other than the repeat itself.

I can confirm this behaviour. I created a test page quite a while ago, probably when the array component was released. I don’t remember this ‘countdown effect’. I hardly notice it with 20 records, but with 200 for example there is a significant delay.

Also, again more noticeable with a larger number, a horizontal scroll bar appears during the countdown process, starting from the bottom left and increasing during the countdown process. If ‘uncheck all’ is selected, the effect appears in reverse: the countdown goes down and the scroll bar starts full-width and decreases. The page concerned has very little content - just a single table. Very strange.

1 Like

There is no limit as such. Taking a look at memory utilization of the tab and running a profiler might give you some idea on which particular function is taking up most resources.

The repeats actually have been the most resource eating components in my experience… that is because all the dynamic formatters you would have inside the repeat, will get processed for each row.

1 Like

Thank you both.

I’ll look at the page and see where I can make some savings to see if it changes anything. I might set up a basic test, too. Perhaps the array component is able to be optimised if it is indeed causing the same even for simple pages as per Tom’s post.

@mgaussie, it could be other things on the page that take you near the limit and the array issue you have is just where it becomes visible…

I try to move all things that I used to do with a .where() or variables inside a repeat out to database views or sever actions now… the speed difference is just incredible.

1 Like