medic / care-teams

For Product Management
0 stars 0 forks source link

contact_list apdex: research and development cycle 1 #91

Closed michaelkohn closed 5 months ago

michaelkohn commented 5 months ago

One week time-box to do all of the following 👇 (1-4) as many times as necessary to get to 0.94 for contact_list.

  1. Research
  2. Plan
  3. Develop
  4. Evaluate

If 0.94 not achieved in 1 week, we will evaluate at the end of the week if we want to allocate an additional 1 week time-box for more work.

Benmuiruri commented 5 months ago

I have reviewed the contactsComponent, searchService and the search library and these are the findings of my research.

contactsComponent

searchService

  1. I did not find any possible improvements to make to improve performance.

search library

  1. Stefan left a comment to consider rewriting to not support skip and limit because they might not be fast. An issue was created but closed without the code being refactored.
  2. There are multiple and nested iterations in the getIntersection method. Refactoring the method to use a single pass approach to calculate the intersection might improve performance. Also using _.intersection() involves creating several temporary arrays and then comparing all elements across these arrays to find common elements, which can be inefficient.
Benmuiruri commented 5 months ago

Hi @michaelkohn

After further review of the getIntersection method the refactor would add more complexity to the search service without offering any significant consistent performance improvements.

Therefore for this research and development cycle 1:

I would suggest marking cycle 1 as done and opening cycle 2 which will include:

  1. Seeing whether it is possible to avoid mapping twice in the search lib
  2. Investigate how we query for contacts_by_last_visited (code) in the searchService and in the contactsComponent
  3. How we calculate getLastVisitedDates
  4. Conduct a performance comparison of fetching 50 contacts (default) and fetching feww35
  5. Review the query method in the contacts-component
michaelkohn commented 5 months ago

Sounds good, thanks @Benmuiruri.