New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Low performance in Reports tab for users with thousands of places #8576
Comments
For the record, things that we considered; not necessarily we're going to do it exactly like this, but these are ideas that can help improve performance:
|
@garethbowen I've pushed the last commit, and this is ready for handover and get it to the finish line. Thanks a lot! |
I have reproduced this issue on |
Testing plan...
Before the change: CPU spikes to 100% for a few seconds Testing matrix...
|
Hey @garethbowen - I'm getting some questions from both CARES app and NSSD app about how much this fix will impact performance for their offline users. CARES users have ~5600 contacts on their device (dunno if that's helpful). SInce you have this repro setup already - are there some time measurements before/after the fix which would be helpful to answer this? Maybe CPU throttling? |
Just checking if I am doing the right thing @garethbowen . I can see a jump in CPU usage popping up for a while. Is this what we are supposed to check (note this is on master, but I also saw some spike with the branch, so I wanted to check before continuing) > See recording |
@kennsippell Yes it might help them. Are the contacts places or people? The way to easily check is to open the places filter on the reports tab. If it's a long list (1k or above) then they will probably be getting this error. If places in the filter are being rendered one by one, then you've hit this issue for sure. This issue only impacts the Reports tab and you can use the other tabs just fine as long as you never go to the reports. On my beefy desktop loading 1k places went from about 3 seconds of 100% CPU to basically instant. Much of this happens in the background so if you navigate to another screen it still feels sluggish until it's finished processing the places. Happy to jump on a call to debug specific apps if that's helpful! |
@ngaruko Looks right to me. The processes have different names in different OSes but the |
Thanks @garethbowen . I got a little confused on the PR, there was another process spiking to over 100% ( |
@ngaruko Thanks. Can you also test that the filters, particularly the place filter, still functions as you'd expect? Also keep an eye on performance as you test the filters... |
@garethbowen from a performance POV, it looks ok. However, some search terms bring results that do not contain any of the elements of the term, ie in this screenshot, search term Recording here |
IIRC short search terms are ignored so searching for "65" is the same as no filter. The change was actually in the Places filter on the Reports tab where it looks like you're testing the Freetext (or Search) filter on the People tab. Can you confirm you tested all the filters on the Reports tab? |
All the filters on the reports tab work as expected, but then again I didn't load a lot of reports, enough to gauge the performance. Is that critical @garethbowen ? |
I was mostly interested in double checking the filters work, but with and without the feature flag turned on. I had tested the performance thoroughly as part of the fix. Thanks! |
I understand we were hoping #8577 would resolve this issue. Today on traffic-lights it was noted that the issue persists. |
@craig-landry To clarify - we were hoping this issue would ease some of the client-side performance complaints we have been hearing from NSSD and CARES projects. Although this is an important performance improvement and does seem to net gains for some users -- it doesn't seem to net significant gains for offline users in these specific two projects. The reason is the shape of their contact data - one has a lot of places but they aren't directly under the user's facility and the other has a lot of contacts but they aren't places. |
Merged and backported to |
I read through all the comments on this issue and it's not clear to me what the actual solution was and what, if anything, will look different to users (other than it hopefully being faster now). Was it one of the options mentioned in this comment? |
From the PR the 3 changes were...
Number 1 doesn't change the UI in any way. This was the main issue and was caused by a mix up between the old filter code and the new filter code. Number 2 and 3 may introduce slight delays when opening the filter sidebar because we're delaying rendering the filter options from page load to filter open. I think this is a good tradeoff because most people don't open the filters on most page loads. Other than the slight delay, there should be no UX change. |
Describe the bug
Report tab is slow on instances with thousands of places, some numbers:
To Reproduce
On the second load, the reports tab is very slow, maxes out a CPU, and eventually logs in the browser console
Uncaught RangeError: Maximum call stack size exceeded
.Expected behavior
Should not be slow.
Environment
Additional context
Angular seems to have infinite recursion from internal calls from
refreshView(tView, lView, templateFn, context)
to refreshEmbeddedViews(lView) and back again.The text was updated successfully, but these errors were encountered: