Skip to content

App performance issues #3766

Closed
Closed

Description

@rkareko

The following performance issue have been noticed when running the app in the field by the WDF team

  1. Slow loading of forms
  2. Slow saving of forms

Metrics
Collect the following metrics : -

  • Load times for various forms
  • Have a break down of the various resources
  • Phone specs - RAM, CPU, storage

Activity

  1. self-assigned this
    on Jul 31, 2025
  2. ajhmohammed commented on Aug 5, 2025

    @ajhmohammed

    The debug apk took somewhere between 3.5 to 5 seconds to load the questionnaire and 20 to 25s to save the questionnaire
    The release apk took around 2 to 3.5 seconds to load the questionnaire and 10 to 15 seconds to save.

    Both test carried out with different devices with different patients counts.
    Example
    device 1: with 49 patients
    device 2: 5587 patients

  3. ajhmohammed commented on Aug 17, 2025

    @ajhmohammed

    Stats from Prod Instance Release APK.

    Total Number of Patients: 5624

    Other Resources count

    QuestionnaireResponse: 15331
    Observation: 119010
    Flag: 74510
    Condition: 8044
    Appointment: 101449
    Task: 11562
    Encounter: 391812
    

    Total Number of Resources: 727342

    Device Information

    Device Brand & Model: Samsung Galaxy A06 (SM-A065F/DS)
    Android Version: 14 
    RAM: 6GB
    Storage: 128GB
    CPU: Mediatek Helio G85 (2.0GHz)
    

    Available Forms and Stats (Offline Test) - Arranged in the priority order

    Blood Pressure
    > No. of Lines: 442
    > Loading TIme: 2.11 seconds
    > Saving TIme: 5.51 seconds
    
    Glucose Mesure
    > No. of Lines: 686
    > Loading TIme: 2.01 seconds
    > Saving TIme: 5.41 seconds
    
    BMI
    > No. of Lines: 454
    > Loading TIme: 1.93 seconds
    > Saving TIme: 5.56 seconds
    
    Medicines
    > No. of Lines: 6201
    > Loading TIme: 2.55 seconds
    > Saving TIme: 6.94 seconds
    
    Add Patient 
    > No. of Lines: 962
    > Loading TIme: 1.86 seconds
    > Saving TIme: 3.72 seconds
    
    Eye Assessment
    > No. of Lines: 195
    > Loading TIme: 1.94 seconds
    > Saving TIme: 4.23 seconds
    
    Foot Assessment
    > No. of Lines: 148
    > Loading TIme: 1.89 seconds
    > Saving TIme: 3.95 seconds
    
    CKD Assessment
    > No. of Lines: 171
    > Loading TIme: 1.93 seconds
    > Saving TIme: 6.25 seconds
    
    Appointment Scheduling
    > No. of Lines: 211
    > Loading TIme: 2.31 seconds
    > Saving TIme: 5.99 seconds
    
    Add Diagnosis
    > No. of Lines: 329
    > Loading TIme: 1.77 seconds
    > Saving TIme: 5.30 seconds
    
    Add Notes
    > No. of Lines: 135
    > Loading TIme: 1.85 seconds
    > Saving TIme: 1.43 seconds
    
    
  4. jingtang10 commented on Sep 8, 2025

    @jingtang10

    @ajhmohammed thanks for sharing this.

    can you please profile the specific api calls?

    i don't think we need to do this for all questionnaires, just take a typical questionnaire for example, and just print out the timestamp before and after the questionnaire fragment call.

    and to do this more systematically, we can use https://developer.android.com/studio/profile. but let's have a rough idea first.

  5. ajhmohammed commented on Sep 10, 2025

    @ajhmohammed
    2025-09-10 15:09:36.148 31855-31855 System.out              org...srp.demoDiabetesCompassClinic  I  questionnaireResponseValid => 106.741923ms
    2025-09-10 15:09:36.151 31855-31855 System.out              org...srp.demoDiabetesCompassClinic  I  qrmeta => 2.862461ms
    2025-09-10 15:09:36.805 31855-31855 System.out              org...srp.demoDiabetesCompassClinic  I  Extracts => 653.031077ms
    2025-09-10 15:09:36.805 31855-31855 System.out              org...srp.demoDiabetesCompassClinic  I  bundles => 653.683769ms
    2025-09-10 15:09:45.857 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 12.113769ms, updates => 88.376616ms
    2025-09-10 15:09:53.717 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 7.562153ms, updates => 59.632692ms
    2025-09-10 15:09:53.926 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  saveExtractedRes => 17.116311771s
    2025-09-10 15:10:01.577 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 20.802693ms, updates => 129.836538ms
    2025-09-10 15:10:01.577 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  lastUpdatedProp => 7.651122077s
    2025-09-10 15:10:01.598 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  subject => 20.382847ms
    2025-09-10 15:10:01.610 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  extractedResource => 9.628ms
    2025-09-10 15:10:01.711 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  generateCarePlan => 100.652692ms
    2025-09-10 15:10:01.714 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  cqlExecute => 2.664231ms
    2025-09-10 15:10:01.715 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  careplanGen => 159.153us
    2025-09-10 15:10:13.345 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 7.490769ms, updates => 80.385230ms
    2025-09-10 15:10:27.031 31855-32075 System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 12.212308ms, updates => 73.136923ms
    2025-09-10 15:10:27.064 31855-31855 System.out              org...srp.demoDiabetesCompassClinic  I  defReps => 50.258156618s
    
  6. ajhmohammed commented on Sep 11, 2025

    @ajhmohammed

    After commenting out DefaultRespository.kt line no. 260
    // val updateFrom = res.updateFrom(resource)

    2025-09-11 13:58:24.358  4353-4353  System.out              org...srp.demoDiabetesCompassClinic  I  questionnaireResponseValid => 99.619077ms
    2025-09-11 13:58:24.363  4353-4353  System.out              org...srp.demoDiabetesCompassClinic  I  qrmeta => 4.519ms
    2025-09-11 13:58:24.956  4353-4353  System.out              org...srp.demoDiabetesCompassClinic  I  Extracts => 591.709847ms
    2025-09-11 13:58:24.956  4353-4353  System.out              org...srp.demoDiabetesCompassClinic  I  bundles => 592.534769ms
    2025-09-11 13:58:25.775  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 7.503615ms, updates => 87.819462ms
    2025-09-11 13:58:25.885  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 8.388923ms, updates => 79.028ms
    2025-09-11 13:58:26.065  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  saveExtractedRes => 1.105149846s
    2025-09-11 13:58:26.251  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 17.968231ms, updates => 148.611077ms
    2025-09-11 13:58:26.251  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  lastUpdatedProp => 185.730462ms
    2025-09-11 13:58:26.271  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  subject => 19.507693ms
    2025-09-11 13:58:26.289  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  extractedResource => 11.428616ms
    2025-09-11 13:58:31.576  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  generateCarePlan => 5.287377847s
    2025-09-11 13:58:31.581  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  cqlExecute => 3.936616ms
    2025-09-11 13:58:31.581  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  careplanGen => 269.846us
    2025-09-11 13:58:31.668  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 11.012ms, updates => 71.003692ms
    2025-09-11 13:58:31.810  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 20.310461ms, updates => 120.522462ms
    2025-09-11 13:58:31.938  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 16.135692ms, updates => 111.292923ms
    2025-09-11 13:58:32.041  4353-4678  System.out              org...srp.demoDiabetesCompassClinic  I  Gets => 11.916538ms, updates => 89.205231ms
    2025-09-11 13:58:32.193  4353-4353  System.out              org...srp.demoDiabetesCompassClinic  I  defReps => 7.236592924s
    
  7. LZRS commented on Sep 11, 2025

    @LZRS
    Contributor

    After profiling FHIRCore with logging additions (commit), we've identified these performance bottlenecks.

    When saving a questionnaire, the T.updateFrom(updatedResource: Resource) function, represented by updateFromCalcTime in the logs, consistently took around 2 seconds per resource, contributing to a total time of up to 12 seconds for one of our tests that took ~14s.

    fun <T : Resource> T.updateFrom(updatedResource: Resource): T {

    Logs Saving medicines questionnaire form

    2025-09-10 23:33:25.609  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Encounter/patient-visit-2025-09-10-2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:25.634  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 24.104875ms
    2025-09-10 23:33:25.635  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Encounter/eee7b508-676e-4da5-a833-7d8ff560cf78
    2025-09-10 23:33:25.645  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 10.057125ms
    2025-09-10 23:33:25.646  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => MedicationRequest/dc-med-318956006-2025-09-10-2a6eb94529a346218e45f4e6f3397dda
    2025-09-10 23:33:25.649  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 2.461875ms
    2025-09-10 23:33:25.649  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => MedicationRequest/dc-med-376209006-2025-09-10-2a6eb94529a346218e45f4e6f3397dda
    2025-09-10 23:33:25.651  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 1.870084ms
    2025-09-10 23:33:25.651  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => MedicationRequest/dc-med-325278007-2025-09-10-2a6eb94529a346218e45f4e6f3397dda
    2025-09-10 23:33:25.653  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 1.596250ms
    2025-09-10 23:33:25.654  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:25.666  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 3.559375ms
    2025-09-10 23:33:25.667  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  saveExtractedResources: => Encounter
    2025-09-10 23:33:25.667  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => Encounter
    2025-09-10 23:33:25.669  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets =>  1.407166ms
    2025-09-10 23:33:28.202  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateFromCalcTime: => 2.532677460s
    2025-09-10 23:33:28.250  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Updates: => 47.910167ms
    2025-09-10 23:33:28.250  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets => 1.407166ms, updates => 47.910167ms
    2025-09-10 23:33:28.251  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:28.260  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 9.077708ms
    2025-09-10 23:33:28.261  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  saveExtractedResources: => Encounter
    2025-09-10 23:33:28.261  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => Encounter
    2025-09-10 23:33:28.283  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  CreateTime: => 19.457584ms
    2025-09-10 23:33:28.284  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:28.294  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 9.823125ms
    2025-09-10 23:33:28.295  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  saveExtractedResources: => MedicationRequest
    2025-09-10 23:33:28.295  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => MedicationRequest
    2025-09-10 23:33:28.297  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets =>  1.708875ms
    2025-09-10 23:33:30.670  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateFromCalcTime: => 2.372386043s
    2025-09-10 23:33:30.697  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Updates: => 26.591417ms
    2025-09-10 23:33:30.697  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets => 1.708875ms, updates => 26.591417ms
    2025-09-10 23:33:30.698  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:30.702  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 3.509833ms
    2025-09-10 23:33:30.702  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  saveExtractedResources: => MedicationRequest
    2025-09-10 23:33:30.702  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => MedicationRequest
    2025-09-10 23:33:30.710  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets =>  7.425ms
    2025-09-10 23:33:32.966  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateFromCalcTime: => 2.255935501s
    2025-09-10 23:33:32.987  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Updates: => 20.280416ms
    2025-09-10 23:33:32.993  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets => 7.425ms, updates => 20.280416ms
    2025-09-10 23:33:32.994  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:32.999  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 4.671708ms
    2025-09-10 23:33:32.999  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  saveExtractedResources: => MedicationRequest
    2025-09-10 23:33:32.999  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => MedicationRequest
    2025-09-10 23:33:33.001  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets =>  1.568250ms
    2025-09-10 23:33:35.253  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateFromCalcTime: => 2.252223418s
    2025-09-10 23:33:35.277  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Updates: => 18.797500ms
    2025-09-10 23:33:35.278  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets => 1.568250ms, updates => 18.797500ms
    2025-09-10 23:33:35.278  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:35.282  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 3.183458ms
    2025-09-10 23:33:35.282  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  saveExtractedResources: => MedicationRequest
    2025-09-10 23:33:35.282  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => MedicationRequest
    2025-09-10 23:33:35.283  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets =>  878.792us
    2025-09-10 23:33:37.437  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateFromCalcTime: => 2.153086585s
    2025-09-10 23:33:37.460  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Updates: => 17.12ms
    2025-09-10 23:33:37.460  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets => 878.792us, updates => 17.12ms
    2025-09-10 23:33:37.461  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:37.464  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 3.324500ms
    2025-09-10 23:33:37.465  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => QuestionnaireResponse
    2025-09-10 23:33:37.497  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  CreateTime: => 31.109792ms
    2025-09-10 23:33:37.498  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateResourcesLastUpdatedProperty: =>
    2025-09-10 23:33:37.498  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateResourcesLastUpdatedProperty: => Patient
    2025-09-10 23:33:37.498  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:37.501  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 3.339750ms
    2025-09-10 23:33:37.501  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  addOrUpdate: => Patient
    2025-09-10 23:33:37.513  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets =>  11.198916ms
    2025-09-10 23:33:39.581  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  updateFromCalcTime: => 2.067735918s
    2025-09-10 23:33:39.614  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Updates: => 32.688750ms
    2025-09-10 23:33:39.614  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  Gets => 11.198916ms, updates => 32.688750ms
    2025-09-10 23:33:39.615  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-10 23:33:39.618  8285-8355  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 3.070791ms
    

    total ~14s 9ms

    When loading a questionnaire the ResourceMapper.populate function, represented by resourceMapperPopulate in the logs, took up to 5 seconds although in some occassions it could take less than 1s

    and getQuestionnaireFragmentBuilder consistently took 1-2 seconds


    with questionnaire.json(), questionnaireResponse.json() and launchContextResources .associate { Pair(it.resourceType.name.lowercase(), it.encodeResourceToString()) } each taking ~600ms

    Logs Loading medicines form

    2025-09-11 00:20:06.590  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  retrieveQuestionnaire: => 215.810334ms
    2025-09-11 00:20:06.591  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => Patient/2a6eb945-29a3-4621-8e45-f4e6f3397dda
    2025-09-11 00:20:06.607  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  loadResource: => 15.570208ms
    2025-09-11 00:20:06.607  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  launchContextResources: => 16.453333ms
    2025-09-11 00:20:11.657  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  resourceMapperPopulate: => 5.049630086s
    2025-09-11 00:20:11.705  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  prepopulateConfig: => 47.683167ms
    2025-09-11 00:20:11.826  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  searchQuestionnaireResponse: => 120.720458ms
    2025-09-11 00:20:11.827  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  excludeLinkIdPrepopulation: => 112.167us
    2025-09-11 00:20:11.827  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  populationTime: => 5.235959252s
    2025-09-11 00:20:12.664  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  Resource.json: => 828.200834ms
    2025-09-11 00:20:13.357  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  Resource.json: => 669.201208ms
    2025-09-11 00:20:13.937  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  setLaunchContextMap: => 579.950166ms
    2025-09-11 00:20:13.938  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  getQuestionnaireFragmentBuilder: => 2.103767543s
    2025-09-11 00:20:13.939  9887-9887  System.out              org...opensrp.diabetesCompassClinic  I  renderQuestionnaireTime: => 2.104284918s
    

    total ~7s 349ms

  8. mberg commented on Sep 11, 2025

    @mberg
    Contributor

    On the loading forms

    2025-09-11 00:20:11.827 9887-9887 System.out org...opensrp.diabetesCompassClinic I populationTime: => 5.235959252s

    This is taking 5 seconds which is where the bulk of the slowness is. What is happening here?

  9. mberg commented on Sep 11, 2025

    @mberg
    Contributor

    I guess that's the populate. What does that do? If that fetching the resources to prefill into the form?

  10. LZRS commented on Sep 11, 2025

    @LZRS
    Contributor

    Yeah, it populates the questionnaire with resources referenced through the sdc-questionnaire-launchContext extension

  11. moved this from 🆕 New to 🏗 In progress in OHS Eng Sprint Tracker '23-25on Sep 16, 2025
  12. LZRS commented on Sep 16, 2025

    @LZRS
    Contributor

    The next steps of action will be

    • Evaluate the necessity of the T.updateFrom(updatedResource: Resource) function and in case its needed, try to optimise and - @rkareko @LZRS @ajhmohammed (FHIRCore)
      Moved to a separate coroutineScope within the default dispatcher thread

    - [ ] For loading of a questionnaire, check whether a questionnaire has launchContext extension to prevent redundant call to ResourceMapper.populate function @rkareko @LZRS (FHIRCore)

    - [ ] In the sdc, we can add a check to only do ResourceMapper.populate population processing only a questionnaire has launchContext extension @LZRS (SDC)
    Doesn't seem to work for questionnaires using fhirpath expression today() as an initialExpression, without defined launchContext extension

    • For the getQuestionnaireFragmentBuilder and for the extension function Resource.encodeResourceToString(), ensure that only a single instance of FhirContext.forR4().getCustomJsonParser() is used, to shave off time used to initialize every time @rkareko @LZRS (FHIRCore)

    • Explore triggering pre-initialization of the fhirPathEngine beforehand (on app start-up) to remove time taken to initialize it when loading a questionnaire @LZRS

    - [ ] Launch generateCarePlan and executeCQL into a separate thread to not block saving @LZRS
    Pulled back on this as some CarePlans were not getting generated in time to interact with a patient's profile

    • Evaluate feasibility (UI/UX) of asynchronous saving of questionnaire especially when extracted resources are many @rkareko @LZRS (FHIRCore)

    @ajhmohammed will assist with testing the effectiveness of the above steps

  13. 15 remaining items

  14. mberg commented on Oct 9, 2025

    @mberg
    Contributor
  15. FikriMilano commented on Oct 9, 2025

    @FikriMilano
    Member

    @mberg

    My short guess is, it's because of we run PlanDefinition which generates all the tasks the patient needs (around 44 tasks) on submission of registration form. This doesn't happen on other forms.

    I'll re-check registration form and get back to you on the details.

  16. mberg commented on Oct 9, 2025

    @mberg
    Contributor
  17. moved this from 🆕 New to 👀 In review in OHS Eng Sprint Tracker '23-25on Oct 10, 2025
  18. ajhmohammed commented on Dec 5, 2025

    @ajhmohammed

    Hi @jingtang10 , @mberg & @rkareko, I have tested this version of the app witht the users and got a very postive feedback. Unfortunately when testing app, I found out that the auto calculated date field on the form did not auto populate after this change.

    Just to make sure, i recompiled the app with the main branch and its confirmed that the performance improvement made a breaking change.

  19. jingtang10 commented on Dec 5, 2025

    @jingtang10

    @LZRS has a fix for it I think

  20. LZRS commented on Dec 5, 2025

    @LZRS
    Contributor

    Yes, I have the fix here ohs-foundation/android-fhir#2923

    Whereby the widgets UI were not getting updated for calculated expressions.

    Although, I'll have to confirm if the fix works for Android views that had not been migrated to compose.

  21. LZRS commented on Dec 5, 2025

    @LZRS
    Contributor

    @ajhmohammed Could you confirm which branch you were using? I believe the performance improvement work had already been merged to the main branch

  22. ajhmohammed commented on Dec 5, 2025

    @ajhmohammed

    Hi @LZRS & @jingtang10 my bad, its a wrong branch. The bug was on the branch #3804

  23. LZRS commented on Dec 5, 2025

    @LZRS
    Contributor

    Hi @LZRS & @jingtang10 my bad, its a wrong branch. The bug was on the branch #3804

    Oh, okay. No worries

  24. LZRS commented on Dec 10, 2025

    @LZRS
    Contributor

    @ajhmohammed The PR #3804 has been updated with a fix
    @rkareko

  25. moved this from 👀 In review to ✅ Done in OHS Eng Sprint Tracker '23-25on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions