[WIP] Lazy loading content in the contact's left panel #4999
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change paints the "Contacts Panel" (left panel on the contact's tab) in two steps. This results in increased perceived performance and can reduce the user's time to complete tasks. The user can interact with the page faster, while still getting the rich experiences which require longer load times.
#4445
The Downside - This change requires the user to paint twice. Painting with Live-List is a costly operation, so the total time to the richer experience is regressed by this change (particularly when displayLastVisitedDates is false). I'd say this is concerning and makes this a questionable win, particularly with #4998 in the pipe. We may want to consider performance optimizations to Live-List before considering this.
The first paint triggers as soon as the contacts are fetched with no meta data (last visited date, primary contact, etc.). The second paint updates the existing page with the meta data after it is fetched.
Related Changes - This can compliment both #4982 and #4998. Though #4998 reduces the time to fetch metadata and therefore reduces the upside of this change.
An Edge Case - When the user selects to "sort by last visited," the content re-sorts on the second paint. This shuffle is likely confusing for users. Therefore, this lazy-loading experience is disabled when sorting by last visited date.
The changes in GetDataSource and Search should scale to lazy loading content elsewhere (contacts-content panel, reports page, etc.)
Results
All times in milliseconds.
Times in format
x/y
- Thex
is time to first paint. They
is time to second paint.Times are for heavy district admin user
adamayo
using muso-mali configurations.Performance for displayLastVisitedDates=true
Performance for displayLastVisitedDates=false
Review checklist
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.