cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

Improve Apdex score of contact_list

Open Benmuiruri opened this issue 10 months ago • 1 comments

Describe the performance issue Care Teams KR Initial research done

In the first cycle of performance optimisation I did not find any glaring performance bottlenecks. In this issue I suggest two refactors that might improve performance or at least better maintainability that could lead to potentially improved performance.

contactsComponent

  1. In contacts-component.ts, the ngOnInit method mixes synchronous and asynchronous logic (code) which can be refactored to use async - await
  2. The initialization of the contacts Component can also be wrapped in a try - catch block to allow for centralized error handling instead of error handling in each promise.
  3. The subscription management (code) can also be refactored into a separate method. This wont particularly lead to a performance gain but it improves the separation of concerns.

searchService

In looking for ways to optimize the contact_list:query I reviewed the search library and there could be possible optimization by avoiding redundancy of responses.map

Benmuiruri avatar Apr 12 '24 06:04 Benmuiruri

Moved to 4.8.0 so as not to hold up the release.

garethbowen avatar Apr 26 '24 10:04 garethbowen