cht-core
cht-core copied to clipboard
Improve Apdex score of contact_list
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
- In contacts-component.ts, the
ngOnInit
method mixes synchronous and asynchronous logic (code) which can be refactored to useasync - await
- 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. - 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
Moved to 4.8.0 so as not to hold up the release.