Skip to content
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

[WIP] Lazy loading content in the contact's left panel #4999

Closed
wants to merge 1 commit into from

Conversation

kennsippell
Copy link
Member

@kennsippell kennsippell commented Nov 19, 2018

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 - The x is time to first paint. The y is time to second paint.
Times are for heavy district admin user adamayo using muso-mali configurations.

Performance for displayLastVisitedDates=true

Scenario Trial 1 Trial 2 Trial 3 Mean
SM-G903W master 4562 3420 3595 3869
SM-G903W proposed 741/4194 700/3814 715/3806 718/3938
SM-G361H master 8145 7259 7245 7549
SM-G361H proposed 1828/6937 1632/6426 1575/6642 1678/6668

Performance for displayLastVisitedDates=false

Scenario Trial 1 Trial 2 Trial 3 Mean
SM-G903W master 981 880 808 889
SM-G903W proposed 829/1440 720/1345 669/1266 740/1350
SM-G361H master 2005 1815 1907 1909
SM-G361H proposed 1476/2795 1612/2818 1207/2318 1432/2643

Review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Announced in Changes.md in plain English. Configuration and user documentation on medic-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in Changes.md.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@kennsippell
Copy link
Member Author

kennsippell commented Nov 19, 2018

Just realised, could lazy load the contact list in the right-panel with this code and measure the impact there instead of the left-panel. This avoids the cost of drawing through Live-List...

@kennsippell
Copy link
Member Author

Closing this in wait of #4998. Will re-open if we upgrade to angular or speed up live-list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant