OpenClinica/enketo-express-oc

Optimize headless sessions

Closed this issue · 5 comments

  • See if we can use one browser, multiple tabs.
  • Anything other low-hanging fruit
  • figure out how to benchmark
  1. configure Enketo to use 8 cores
  2. run shell script: (sh ./tools/benchmark-headless.sh)
#!/bin/sh
INSTANCE="<data xmlns:OpenClinica=\"http://openclinica.com/odm\" xmlns:enk=\"http://enketo.org/xforms\" xmlns:jr=\"http://openrosa.org/javarosa\" xmlns:oc=\"http://openclinica.org/xforms\" xmlns:orx=\"http://openrosa.org/xforms\" id=\"LabsReconciliation\" version=\"1\"><LB><current_date>2021-02-07</current_date><event_date>18665.541666666664</event_date><todays_date/><creat_codes>38483-4 2160-0 2161-8</creat_codes><creat_max>18664.770833333332</creat_max><creat_reads><creat_repkey>37</creat_repkey><creatinine_raw>0.8</creatinine_raw><creat_unit_raw>mg/dL</creat_unit_raw><creat_ref_low_raw>.7</creat_ref_low_raw><creat_ref_high_raw>1.3</creat_ref_high_raw><creat_obsid_raw/><creat_eff_date>2021-02-06T18:30:00Z</creat_eff_date></creat_reads><eff_date1>2021-02-06</eff_date1><CREAT_COL>Y</CREAT_COL><creat_details><CREAT>0.8</CREAT><CREAT_UNIT>mg/dL</CREAT_UNIT><CREAT_REF_LOW>0.7</CREAT_REF_LOW><CREAT_REF_HIGH>1.3</CREAT_REF_HIGH><CREAT_OOR_CLIN_SIG/><CREAT_AE_NOTE/><CREAT_OBSID/><CREAT_comment oc:queryParent=\"CREAT\"/><CREAT_UNIT_comment oc:queryParent=\"CREAT_UNIT\"/><CREAT_REF_LOW_comment oc:queryParent=\"CREAT_REF_LOW\"/><CREAT_REF_HIGH_comment oc:queryParent=\"CREAT_REF_HIGH\"/><CREAT_OOR_CLIN_SIG_comment oc:queryParent=\"CREAT_OOR_CLIN_SIG\"/><CREAT_AE_NOTE_comment oc:queryParent=\"CREAT_AE_NOTE\"/><CREAT_OBSID_comment oc:queryParent=\"CREAT_OBSID\"/></creat_details><NOTE_CREAT/><ALT2_codes>1742-6 1743-4</ALT2_codes><ALT2_max>NaN</ALT2_max><ALT2_reads><ALT2_repkey/><ALT2_raw/><ALT2_unit_raw/><ALT2_ref_low_raw/><ALT2_ref_high_raw/><ALT2_obsid_raw/><ALT2_eff_date/></ALT2_reads><eff_date2/><ALT2_COL>N</ALT2_COL><ALT2_details><ALT2/><ALT2_UNIT/><ALT2_REF_LOW/><ALT2_REF_HIGH/><ALT2_OOR_CLIN_SIG/><ALT2_AE_NOTE/><ALT2_OBSID/><ALT2_comment oc:queryParent=\"ALT2\"/><ALT2_UNIT_comment oc:queryParent=\"ALT2_UNIT\"/><ALT2_REF_LOW_comment oc:queryParent=\"ALT2_REF_LOW\"/><ALT2_REF_HIGH_comment oc:queryParent=\"ALT2_REF_HIGH\"/><ALT2_OOR_CLIN_SIG_comment oc:queryParent=\"ALT2_OOR_CLIN_SIG\"/><ALT2_AE_NOTE_comment oc:queryParent=\"ALT2_AE_NOTE\"/><ALT2_OBSID_comment oc:queryParent=\"ALT2_OBSID\"/></ALT2_details><NOTE_ALT2/><AST_codes>1920-8</AST_codes><AST_max>NaN</AST_max><AST_reads><AST_repkey/><AST_raw/><AST_unit_raw/><AST_ref_low_raw/><AST_ref_high_raw/><AST_obsid_raw/><AST_eff_date/></AST_reads><eff_date3/><AST_COL>N</AST_COL><AST_details><AST/><AST_UNIT/><AST_REF_LOW/><AST_REF_HIGH/><AST_OOR_CLIN_SIG/><AST_AE_NOTE/><AST_OBSID/><AST_comment oc:queryParent=\"AST\"/><AST_UNIT_comment oc:queryParent=\"AST_UNIT\"/><AST_REF_LOW_comment oc:queryParent=\"AST_REF_LOW\"/><AST_REF_HIGH_comment oc:queryParent=\"AST_REF_HIGH\"/><AST_OOR_CLIN_SIG_comment oc:queryParent=\"AST_OOR_CLIN_SIG\"/><AST_AE_NOTE_comment oc:queryParent=\"AST_AE_NOTE\"/><AST_OBSID_comment oc:queryParent=\"AST_OBSID\"/></AST_details><NOTE_AST/><BILIRUBIN_codes>1975-2 1974-5 42719-5</BILIRUBIN_codes><BILIRUBIN_max>NaN</BILIRUBIN_max><BILIRUBIN_reads><BILIRUBIN_repkey/><BILIRUBIN_raw/><BILIRUBIN_unit_raw/><BILIRUBIN_ref_low_raw/><BILIRUBIN_ref_high_raw/><BILIRUBIN_obsid_raw/><BILIRUBIN_eff_date/></BILIRUBIN_reads><eff_date4/><BILIRUBIN_COL>N</BILIRUBIN_COL><BILIRUBIN_details><BILIRUBIN/><BILIRUBIN_UNIT/><BILIRUBIN_REF_LOW/><BILIRUBIN_REF_HIGH/><BILIRUBIN_OOR_CLIN_SIG/><BILIRUBIN_AE_NOTE/><BILIRUBIN_OBSID/><BILIRUBIN_comment oc:queryParent=\"BILIRUBIN\"/><BILIRUBIN_UNIT_comment oc:queryParent=\"BILIRUBIN_UNIT\"/><BILIRUBIN_REF_LOW_comment oc:queryParent=\"BILIRUBIN_REF_LOW\"/><BILIRUBIN_REF_HIGH_comment oc:queryParent=\"BILIRUBIN_REF_HIGH\"/><BILIRUBIN_OOR_CLIN_SIG_comment oc:queryParent=\"BILIRUBIN_OOR_CLIN_SIG\"/><BILIRUBIN_AE_NOTE_comment oc:queryParent=\"BILIRUBIN_AE_NOTE\"/><BILIRUBIN_OBSID_comment oc:queryParent=\"BILIRUBIN_OBSID\"/></BILIRUBIN_details><NOTE_BILIRUBIN/><ALP_codes>test</ALP_codes><ALP_max>NaN</ALP_max><ALP_reads><ALP_repkey/><ALP_raw/><ALP_unit_raw/><ALP_ref_low_raw/><ALP_ref_high_raw/><ALP_obsid_raw/><ALP_eff_date/></ALP_reads><eff_date5/><ALP_COL>N</ALP_COL><ALP_det><ALP/><ALP_UNIT/><ALP_REF_LOW/><ALP_REF_HIGH/><ALP_OOR_CLIN_SIG/><ALP_AE_NOTE/><ALP_OBSID/><ALP_comment oc:queryParent=\"ALP\"/><ALP_UNIT_comment oc:queryParent=\"ALP_UNIT\"/><ALP_REF_LOW_comment oc:queryParent=\"ALP_REF_LOW\"/><ALP_REF_HIGH_comment oc:queryParent=\"ALP_REF_HIGH\"/><ALP_OOR_CLIN_SIG_comment oc:queryParent=\"ALP_OOR_CLIN_SIG\"/><ALP_AE_NOTE_comment oc:queryParent=\"ALP_AE_NOTE\"/><ALP_OBSID_comment oc:queryParent=\"ALP_OBSID\"/></ALP_det><NOTE_ALP/><PLATELETS_codes>777-3 776-5 890-4 26515-7 1988-5 54413-0 9317-9 32623-1 8098-6 11039-5 5908-9 32146-3 8061-4 24471-5 34701-3 19066-0 14869-2 21027-8 3013-0 3284-7 75506-6 48593-8 56006-0 45370-4 43302-9 32208-1 38420-6 22759-5 5581-4 29997-4 2940-5</PLATELETS_codes><PLATELETS_max>NaN</PLATELETS_max><PLATELETS_reads><PLATELETS_repkey/><PLATELETS_raw/><PLATELETS_unit_raw/><PLATELETS_ref_low_raw/><PLATELETS_ref_high_raw/><PLATELETS_obsid_raw/><PLATELETS_eff_date/></PLATELETS_reads><eff_date6/><PLATELETS_COL>N</PLATELETS_COL><PLATELETS_det><PLATELETS/><PLATELETS_UNIT/><PLATELETS_REF_LOW/><PLATELETS_REF_HIGH/><PLATELETS_OOR_CLIN_SIG/><PLATELETS_AE_NOTE/><PLATELETS_OBSID/><PLATELETS_comment oc:queryParent=\"PLATELETS\"/><PLATELETS_UNIT_comment oc:queryParent=\"PLATELETS_UNIT\"/><PLATELETS_REF_LOW_comment oc:queryParent=\"PLATELETS_REF_LOW\"/><PLATELETS_REF_HIGH_comment oc:queryParent=\"PLATELETS_REF_HIGH\"/><PLATELETS_OOR_CLIN_SIG_comment oc:queryParent=\"PLATELETS_OOR_CLIN_SIG\"/><PLATELETS_AE_NOTE_comment oc:queryParent=\"PLATELETS_AE_NOTE\"/><PLATELETS_OBSID_comment oc:queryParent=\"PLATELETS_OBSID\"/></PLATELETS_det><NOTE_PLATELETS/><HEMATOCRIT_codes>4544-3 20570-8 42908-4 11153-4 4545-0</HEMATOCRIT_codes><HEMATOCRIT_max>18664.75</HEMATOCRIT_max><HEMATOCRIT_reads><HEMATOCRIT_repkey>12</HEMATOCRIT_repkey><HEMATOCRIT_raw>42.9</HEMATOCRIT_raw><HEMATOCRIT_unit_raw>%</HEMATOCRIT_unit_raw><HEMATOCRIT_ref_low_raw>Not Available</HEMATOCRIT_ref_low_raw><HEMATOCRIT_ref_high_raw>Not Available</HEMATOCRIT_ref_high_raw><HEMATOCRIT_obsid_raw>e4oeoPimAli1UeYP771m7V1xvVjJkgE7xQ2R3Z-TnwYPolqgvyWbCZK25O.Stoa0Y3</HEMATOCRIT_obsid_raw><HEMATOCRIT_eff_date>2021-02-06T18:00:00Z</HEMATOCRIT_eff_date></HEMATOCRIT_reads><eff_date7>2021-02-06</eff_date7><HEMATOCRIT_COL>Y</HEMATOCRIT_COL><HEMATOCRIT_det><HEMATOCRIT>42.9</HEMATOCRIT><HEMATOCRIT_UNIT>%</HEMATOCRIT_UNIT><HEMATOCRIT_REF_LOW/><HEMATOCRIT_REF_HIGH/><HEMATOCRIT_OOR_CLIN_SIG/><HEMATOCRIT_AE_NOTE/><HEMATOCRIT_OBSID>e4oeoPimAli1UeYP771m7V1xvVjJkgE7xQ2R3Z-TnwYPolqgvyWbCZK25O.Stoa0Y3</HEMATOCRIT_OBSID><HEMATOCRIT_comment oc:queryParent=\"HEMATOCRIT\"/><HEMATOCRIT_UNIT_comment oc:queryParent=\"HEMATOCRIT_UNIT\"/><HEMATOCRIT_REF_LOW_comment oc:queryParent=\"HEMATOCRIT_REF_LOW\"/><HEMATOCRIT_REF_HIGH_comment oc:queryParent=\"HEMATOCRIT_REF_HIGH\"/><HEMATOCRIT_OOR_CLIN_SIG_comment oc:queryParent=\"HEMATOCRIT_OOR_CLIN_SIG\"/><HEMATOCRIT_AE_NOTE_comment oc:queryParent=\"HEMATOCRIT_AE_NOTE\"/><HEMATOCRIT_OBSID_comment oc:queryParent=\"HEMATOCRIT_OBSID\"/></HEMATOCRIT_det><NOTE_HEMATOCRIT/><HGB_codes>718-7 785-6 786-4 55782-7 5794-3 57751-0 17856-6 4548-4 11559-2 725-2 17855-8 30391-7 4546-8 721-1 4552-6 4576-5 2614-6 20563-3 4625-0 49316-3 2615-3 2714-4 2030-5 30313-1 19225-2 13954-3 46740-7 4563-3 4551-8 42248-5 34660-1 2617-9 2716-9 2032-1 19227-8 19146-0 12710-0 9749-3 31157-1 15082-1 4575-7 20572-4 32683-5 5191-2 28067-7 41619-8 2616-1 2715-1 2031-3 55373-5 31156-3 49322-1 19226-0 2613-8 13514-5 13515-2 33509-1 33411-0</HGB_codes><HGB_max>18664.75</HGB_max><HGB_reads><HGB_repkey>9</HGB_repkey><HGB_raw>15</HGB_raw><HGB_unit_raw>g/dL</HGB_unit_raw><HGB_ref_low_raw>14</HGB_ref_low_raw><HGB_ref_high_raw>17</HGB_ref_high_raw><HGB_obsid_raw>e4oeoPimAli1UeYP771m7V1xvVjJkgE7xQ2R3Z-TnwYPl5bE9D-id3W0byUWCTzQB3</HGB_obsid_raw><HGB_eff_date>2021-02-06T18:00:00Z</HGB_eff_date></HGB_reads><eff_date8>2021-02-06</eff_date8><HGB_COL>Y</HGB_COL><HGB_det><HGB>15</HGB><HGB_UNIT>g/dL</HGB_UNIT><HGB_REF_LOW>14</HGB_REF_LOW><HGB_REF_HIGH>17</HGB_REF_HIGH><HGB_OOR_CLIN_SIG/><HGB_AE_NOTE/><HGB_OBSID>e4oeoPimAli1UeYP771m7V1xvVjJkgE7xQ2R3Z-TnwYPl5bE9D-id3W0byUWCTzQB3</HGB_OBSID><HGB_comment oc:queryParent=\"HGB\"/><HGB_UNIT_comment oc:queryParent=\"HGB_UNIT\"/><HGB_REF_LOW_comment oc:queryParent=\"HGB_REF_LOW\"/><HGB_REF_HIGH_comment oc:queryParent=\"HGB_REF_HIGH\"/><HGB_OOR_CLIN_SIG_comment oc:queryParent=\"HGB_OOR_CLIN_SIG\"/><HGB_AE_NOTE_comment oc:queryParent=\"HGB_AE_NOTE\"/><HGB_OBSID_comment oc:queryParent=\"HGB_OBSID\"/></HGB_det><NOTE_HGB/><WBC_codes>6690-2 26464-8 50774-9 26466-3 55792-6 47281-1 50957-0</WBC_codes><WBC_max>NaN</WBC_max><WBC_reads><WBC_repkey/><WBC_raw/><WBC_unit_raw/><WBC_ref_low_raw/><WBC_ref_high_raw/><WBC_obsid_raw/><WBC_eff_date/></WBC_reads><eff_date9/><WBC_COL>N</WBC_COL><WBC_det><WBC_COUNT/><WBC_UNIT/><WBC_REF_LOW/><WBC_REF_HIGH/><WBC_OOR_CLIN_SIG/><WBC_AE_NOTE/><WBC_OBSID/><WBC_COUNT_comment oc:queryParent=\"WBC_COUNT\"/><WBC_UNIT_comment oc:queryParent=\"WBC_UNIT\"/><WBC_REF_LOW_comment oc:queryParent=\"WBC_REF_LOW\"/><WBC_REF_HIGH_comment oc:queryParent=\"WBC_REF_HIGH\"/><WBC_OOR_CLIN_SIG_comment oc:queryParent=\"WBC_OOR_CLIN_SIG\"/><WBC_AE_NOTE_comment oc:queryParent=\"WBC_AE_NOTE\"/><WBC_OBSID_comment oc:queryParent=\"WBC_OBSID\"/></WBC_det><NOTE_WBC/><ABS_NEUTROPHIL_codes>test</ABS_NEUTROPHIL_codes><ABS_NEUTROPHIL_max>NaN</ABS_NEUTROPHIL_max><ABS_NEUTROPHIL_reads><ABS_NEUTROPHIL_repkey/><ABS_NEUTROPHIL_raw/><ABS_NEUTROPHIL_unit_raw/><ABS_NEUTROPHIL_ref_low_raw/><ABS_NEUTROPHIL_ref_high_raw/><ABS_NEUTROPHIL_obsid_raw/><ABS_NEUTROPHIL_eff_date/></ABS_NEUTROPHIL_reads><eff_date10/><ABS_NEUTROPHIL_COL>N</ABS_NEUTROPHIL_COL><ABS_NEUTROPHIL_det><ABS_NEUTROPHIL_COUNT/><ABS_NEUTROPHIL_UNIT/><ABS_NEUTROPHIL_REF_LOW/><ABS_NEUTROPHIL_REF_HIGH/><ABS_NEUTROPHIL_OOR_CLIN_SIG/><ABS_NEUTROPHIL_AE_NOTE/><ABS_NEUTROPHIL_OBSID/><ABS_NEUTROPHIL_COUNT_comment oc:queryParent=\"ABS_NEUTROPHIL_COUNT\"/><ABS_NEUTROPHIL_UNIT_comment oc:queryParent=\"ABS_NEUTROPHIL_UNIT\"/><ABS_NEUTROPHIL_REF_LOW_comment oc:queryParent=\"ABS_NEUTROPHIL_REF_LOW\"/><ABS_NEUTROPHIL_REF_HIGH_comment oc:queryParent=\"ABS_NEUTROPHIL_REF_HIGH\"/>\
<ABS_NEUTROPHIL_OOR_CLIN_SIG_comment oc:queryParent=\"ABS_NEUTROPHIL_OOR_CLIN_SIG\"/><ABS_NEUTROPHIL_AE_NOTE_comment oc:queryParent=\"ABS_NEUTROPHIL_AE_NOTE\"/><ABS_NEUTROPHIL_OBSID_comment oc:queryParent=\"ABS_NEUTROPHIL_OBSID\"/></ABS_NEUTROPHIL_det><NOTE_ABS_NEUTROPHIL/><LYMPHOCYTE_codes>731-0 736-9 732-8 26477-0 734-4</LYMPHOCYTE_codes><LYMPHOCYTE_max>NaN</LYMPHOCYTE_max><LYMPHOCYTE_reads><LYMPHOCYTE_repkey/><LYMPHOCYTE_raw/><LYMPHOCYTE_unit_raw/><LYMPHOCYTE_ref_low_raw/><LYMPHOCYTE_ref_high_raw/><LYMPHOCYTE_obsid_raw/><LYMPHOCYTE_eff_date/></LYMPHOCYTE_reads><eff_date11/><LYMPHOCYTE_COL>N</LYMPHOCYTE_COL><LYMPHOCYTE_det><LYMPHOCYTE_COUNT/><LYMPHOCYTE_UNIT/><LYMPHOCYTE_REF_LOW/><LYMPHOCYTE_REF_HIGH/><LYMPHOCYTE_OOR_CLIN_SIG/><LYMPHOCYTE_AE_NOTE/><LYMPHOCYTE_OBSID/><LYMPHOCYTE_COUNT_comment oc:queryParent=\"LYMPHOCYTE_COUNT\"/><LYMPHOCYTE_UNIT_comment oc:queryParent=\"LYMPHOCYTE_UNIT\"/><LYMPHOCYTE_REF_LOW_comment oc:queryParent=\"LYMPHOCYTE_REF_LOW\"/><LYMPHOCYTE_REF_HIGH_comment oc:queryParent=\"LYMPHOCYTE_REF_HIGH\"/><LYMPHOCYTE_OOR_CLIN_SIG_comment oc:queryParent=\"LYMPHOCYTE_OOR_CLIN_SIG\"/><LYMPHOCYTE_AE_NOTE_comment oc:queryParent=\"LYMPHOCYTE_AE_NOTE\"/><LYMPHOCYTE_OBSID_comment oc:queryParent=\"LYMPHOCYTE_OBSID\"/></LYMPHOCYTE_det><NOTE_Lymphocyte/><INR_codes>6301-6</INR_codes><INR_max>NaN</INR_max><INR_reads><INR_repkey/><INR_raw/><INR_unit_raw/><INR_ref_low_raw/><INR_ref_high_raw/><INR_obsid_raw/><INR_eff_date/></INR_reads><eff_date12/><INR_COL>N</INR_COL><INR_det><INR_D/><INR_UNIT/><INR_REF_LOW/><INR_REF_HIGH/><INR_OOR_CLIN_SIG/><INR_AE_NOTE/><INR_OBSID/><INR_D_comment oc:queryParent=\"INR_D\"/><INR_UNIT_comment oc:queryParent=\"INR_UNIT\"/><INR_REF_LOW_comment oc:queryParent=\"INR_REF_LOW\"/><INR_REF_HIGH_comment oc:queryParent=\"INR_REF_HIGH\"/><INR_OOR_CLIN_SIG_comment oc:queryParent=\"INR_OOR_CLIN_SIG\"/><INR_AE_NOTE_comment oc:queryParent=\"INR_AE_NOTE\"/><INR_OBSID_comment oc:queryParent=\"INR_OBSID\"/></INR_det><NOTE_INR/><PTT_codes>14979-9 24476-4 34571-0 24477-2 5946-9 43734-3 5949-3 69049-5 40100-0 33891-3 30323-0 12173-1 52134-4 33356-7 23198-5 5173-0 49058-1 1715-2 15361-9</PTT_codes><PTT_max>NaN</PTT_max><PTT_reads><PTT_repkey/><PTT_raw/><PTT_unit_raw/><PTT_ref_low_raw/><PTT_ref_high_raw/><PTT_obsid_raw/><PTT_eff_date/></PTT_reads><eff_date13/><PTT_COL_3>N</PTT_COL_3><PTT_det><PTT_3/><PTT_UNIT/><PTT_REF_LOW/><PTT_REF_HIGH/><PTT_OOR_CLIN_SIG/><PTT_AE_NOTE/><PTT_OBSID/><PTT_3_comment oc:queryParent=\"PTT_3\"/><PTT_UNIT_comment oc:queryParent=\"PTT_UNIT\"/><PTT_REF_LOW_comment oc:queryParent=\"PTT_REF_LOW\"/><PTT_REF_HIGH_comment oc:queryParent=\"PTT_REF_HIGH\"/><PTT_OOR_CLIN_SIG_comment oc:queryParent=\"PTT_OOR_CLIN_SIG\"/><PTT_AE_NOTE_comment oc:queryParent=\"PTT_AE_NOTE\"/><PTT_OBSID_comment oc:queryParent=\"PTT_OBSID\"/></PTT_det><NOTE_PTT/><DDIMER_codes>48065-7</DDIMER_codes><DDIMER_max>NaN</DDIMER_max><DDIMER_reads><DDIMER_repkey/><DDIMER_raw/><DDIMER_unit_raw/><DDIMER_ref_low_raw/><DDIMER_ref_high_raw/><DDIMER_obsid_raw/><DDIMER_eff_date/></DDIMER_reads><eff_date14/><DDIMER_COL_3>N</DDIMER_COL_3><DDIMER_det><DDIMER_3/><DDIMER_UNIT/><DDIMER_REF_LOW/><DDIMER_REF_HIGH/><DDIMER_OOR_CLIN_SIG/><DDIMER_AE_NOTE/><DDIMER_OBSID/><DDIMER_3_comment oc:queryParent=\"DDIMER_3\"/><DDIMER_UNIT_comment oc:queryParent=\"DDIMER_UNIT\"/><DDIMER_REF_LOW_comment oc:queryParent=\"DDIMER_REF_LOW\"/><DDIMER_REF_HIGH_comment oc:queryParent=\"DDIMER_REF_HIGH\"/><DDIMER_OOR_CLIN_SIG_comment oc:queryParent=\"DDIMER_OOR_CLIN_SIG\"/><DDIMER_AE_NOTE_comment oc:queryParent=\"DDIMER_AE_NOTE\"/><DDIMER_OBSID_comment oc:queryParent=\"DDIMER_OBSID\"/></DDIMER_det><NOTE_DDIMER/><CRP_codes>1988-5 30522-7 11039-5</CRP_codes><CRP_max>NaN</CRP_max><CRP_reads><CRP_repkey/><CRP_raw/><CRP_unit_raw/><CRP_ref_low_raw/><CRP_ref_high_raw/><CRP_obsid_raw/><CRP_eff_date/></CRP_reads><eff_date15/><CRP_COL_3>N</CRP_COL_3><CRP_det><CRP_3/><CRP_UNIT/><CRP_REF_LOW/><CRP_REF_HIGH/><CRP_OOR_CLIN_SIG/><CRP_AE_NOTE/><CRP_OBSID/><CRP_3_comment oc:queryParent=\"CRP_3\"/><CRP_UNIT_comment oc:queryParent=\"CRP_UNIT\"/><CRP_REF_LOW_comment oc:queryParent=\"CRP_REF_LOW\"/><CRP_REF_HIGH_comment oc:queryParent=\"CRP_REF_HIGH\"/><CRP_OOR_CLIN_SIG_comment oc:queryParent=\"CRP_OOR_CLIN_SIG\"/><CRP_AE_NOTE_comment oc:queryParent=\"CRP_AE_NOTE\"/><CRP_OBSID_comment oc:queryParent=\"CRP_OBSID\"/></CRP_det><NOTE_CRP/><BNP_codes>42637-9 33762-6 30934-4</BNP_codes><BNP_max>NaN</BNP_max><BNP_read><BNP_repkey/><BNP_raw/><BNP_unit_raw/><BNP_ref_low_raw/><BNP_ref_high_raw/><BNP_obsid_raw/><BNP_eff_date/></BNP_read><eff_date16/><BNP_COL_3>N</BNP_COL_3><BNP_det><BNP_3/><BNP_UNIT/><BNP_REF_LOW/><BNP_REF_HIGH/><BNP_OOR_CLIN_SIG/><BNP_AE_NOTE/><BNP_OBSID/><BNP_3_comment oc:queryParent=\"BNP_3\"/><BNP_UNIT_comment oc:queryParent=\"BNP_UNIT\"/><BNP_REF_LOW_comment oc:queryParent=\"BNP_REF_LOW\"/><BNP_REF_HIGH_comment oc:queryParent=\"BNP_REF_HIGH\"/><BNP_OOR_CLIN_SIG_comment oc:queryParent=\"BNP_OOR_CLIN_SIG\"/><BNP_AE_NOTE_comment oc:queryParent=\"BNP_AE_NOTE\"/><BNP_OBSID_comment oc:queryParent=\"BNP_OBSID\"/></BNP_det><NOTE_BNP/><TROPONIN_I_codes>test</TROPONIN_I_codes><TROPONIN_I_max>NaN</TROPONIN_I_max><TROPONIN_I_read><TROPONIN_I_repkey/><TROPONIN_I_raw/><TROPONIN_I_unit_raw/><TROPONIN_I_ref_low_raw/><TROPONIN_I_ref_high_raw/><TROPONIN_I_obsid_raw/><TROPONIN_I_eff_date/></TROPONIN_I_read><eff_date17/><TROPONIN_I_COL_3>N</TROPONIN_I_COL_3><TROPONIN_I_det><TROPONIN_I_3/><TROPONIN_I_UNIT/><TROPONIN_I_REF_LOW/><TROPONIN_I_REF_HIGH/><TROPONIN_I_OOR_CLIN_SIG/><TROPONIN_I_AE_NOTE/><TROPONIN_I_OBSID/><TROPONIN_I_3_comment oc:queryParent=\"TROPONIN_I_3\"/><TROPONIN_I_UNIT_comment oc:queryParent=\"TROPONIN_I_UNIT\"/><TROPONIN_I_REF_LOW_comment oc:queryParent=\"TROPONIN_I_REF_LOW\"/><TROPONIN_I_REF_HIGH_comment oc:queryParent=\"TROPONIN_I_REF_HIGH\"/><TROPONIN_I_OOR_CLIN_SIG_comment oc:queryParent=\"TROPONIN_I_OOR_CLIN_SIG\"/><TROPONIN_I_AE_NOTE_comment oc:queryParent=\"TROPONIN_I_AE_NOTE\"/><TROPONIN_I_OBSID_comment oc:queryParent=\"TROPONIN_I_OBSID\"/></TROPONIN_I_det><NOTE_T2/><TROPONIN_T_codes>test</TROPONIN_T_codes><TROPONIN_T_max>NaN</TROPONIN_T_max><TROPONIN_T_read><TROPONIN_T_repkey/><TROPONIN_T_raw/><TROPONIN_T_unit_raw/><TROPONIN_T_ref_low_raw/><TROPONIN_T_ref_high_raw/><TROPONIN_T_obsid_raw/><TROPONIN_T_eff_date/></TROPONIN_T_read><eff_date18/><TROPONIN_T_COL_3>N</TROPONIN_T_COL_3><TROPONIN_T_det><TROPONIN_T_3/><TROPONIN_T_UNIT/><TROPONIN_T_REF_LOW/><TROPONIN_T_REF_HIGH/><TROPONIN_T_OOR_CLIN_SIG/><TROPONIN_T_AE_NOTE/><TROPONIN_T_OBSID/><TROPONIN_T_3_comment oc:queryParent=\"TROPONIN_T_3\"/><TROPONIN_T_UNIT_comment oc:queryParent=\"TROPONIN_T_UNIT\"/><TROPONIN_T_REF_LOW_comment oc:queryParent=\"TROPONIN_T_REF_LOW\"/><TROPONIN_T_REF_HIGH_comment oc:queryParent=\"TROPONIN_T_REF_HIGH\"/><TROPONIN_T_OOR_CLIN_SIG_comment oc:queryParent=\"TROPONIN_T_OOR_CLIN_SIG\"/><TROPONIN_T_AE_NOTE_comment oc:queryParent=\"TROPONIN_T_AE_NOTE\"/><TROPONIN_T_OBSID_comment oc:queryParent=\"TROPONIN_T_OBSID\"/></TROPONIN_T_det><NOTE_T3/><TROPONIN_I_HS_codes>test</TROPONIN_I_HS_codes><TROPONIN_I_HS_max>NaN</TROPONIN_I_HS_max><TROPONIN_I_HS_read><TROPONIN_I_HS_repkey/><TROPONIN_I_HS_raw/><TROPONIN_I_HS_unit_raw/><TROPONIN_I_HS_ref_low_raw/><TROPONIN_I_HS_ref_high_raw/><TROPONIN_I_HS_obsid_raw/><TROPONIN_I_HS_eff_date/></TROPONIN_I_HS_read><eff_date19/><TROPONIN_I_HS_COL_3>N</TROPONIN_I_HS_COL_3><TROPONIN_I_HS_det><TROPONIN_I_HS_3/><TROPONIN_I_HS_UNIT/><TROPONIN_I_HS_REF_LOW/><TROPONIN_I_HS_REF_HIGH/><TROPONIN_I_HS_OOR_CLIN_SIG/><TROPONIN_I_HS_AE_NOTE/><TROPONIN_I_HS_OBSID/><TROPONIN_I_HS_3_comment oc:queryParent=\"TROPONIN_I_HS_3\"/><TROPONIN_I_HS_UNIT_comment oc:queryParent=\"TROPONIN_I_HS_UNIT\"/><TROPONIN_I_HS_REF_LOW_comment oc:queryParent=\"TROPONIN_I_HS_REF_LOW\"/><TROPONIN_I_HS_REF_HIGH_comment oc:queryParent=\"TROPONIN_I_HS_REF_HIGH\"/><TROPONIN_I_HS_OOR_CLIN_SIG_comment oc:queryParent=\"TROPONIN_I_HS_OOR_CLIN_SIG\"/><TROPONIN_I_HS_AE_NOTE_comment oc:queryParent=\"TROPONIN_I_HS_AE_NOTE\"/><TROPONIN_I_HS_OBSID_comment oc:queryParent=\"TROPONIN_I_HS_OBSID\"/></TROPONIN_I_HS_det><NOTE_T4/><TROPONIN_T_HS_codes>test</TROPONIN_T_HS_codes><TROPONIN_T_HS_max>NaN</TROPONIN_T_HS_max><TROPONIN_T_reads><TROPONIN_T_HS_repkey/><TROPONIN_T_HS_raw/><TROPONIN_T_HS_unit_raw/><TROPONIN_T_HS_ref_low_raw/><TROPONIN_T_HS_ref_high_raw/><TROPONIN_T_HS_obsid_raw/><TROPONIN_T_HS_eff_date/></TROPONIN_T_reads><eff_date20/><TROPONIN_T_HS_COL_3>N</TROPONIN_T_HS_COL_3><TROPONIN_T_HS_det><TROPONIN_T_HS_3/><TROPONIN_T_HS_UNIT/><TROPONIN_T_HS_REF_LOW/><TROPONIN_T_HS_REF_HIGH/><TROPONIN_T_HS_OOR_CLIN_SIG/><TROPONIN_T_HS_AE_NOTE/><TROPONIN_T_HS_OBSID/><TROPONIN_T_HS_3_comment oc:queryParent=\"TROPONIN_T_HS_3\"/><TROPONIN_T_HS_UNIT_comment oc:queryParent=\"TROPONIN_T_HS_UNIT\"/><TROPONIN_T_HS_REF_LOW_comment oc:queryParent=\"TROPONIN_T_HS_REF_LOW\"/><TROPONIN_T_HS_REF_HIGH_comment oc:queryParent=\"TROPONIN_T_HS_REF_HIGH\"/><TROPONIN_T_HS_OOR_CLIN_SIG_comment oc:queryParent=\"TROPONIN_T_HS_OOR_CLIN_SIG\"/><TROPONIN_T_HS_AE_NOTE_comment oc:queryParent=\"TROPONIN_T_HS_AE_NOTE\"/><TROPONIN_T_HS_OBSID_comment oc:queryParent=\"TROPONIN_T_HS_OBSID\"/></TROPONIN_T_HS_det><NOTE_T5/><BICARBONATE_codes>1959-6 14627-4 1961-2</BICARBONATE_codes><BICARBONATE_max>18664.75</BICARBONATE_max><BIRCARBONATE_reads><BICARBONATE_repkey>22</BICARBONATE_repkey><BICARBONATE_raw>20</BICARBONATE_raw><BICARBONATE_unit_raw>mmol/L</BICARBONATE_unit_raw><BICARBONATE_ref_low_raw>22</BICARBONATE_ref_low_raw><BICARBONATE_ref_high_raw>29</BICARBONATE_ref_high_raw><BICARBONATE_obsid_raw>eLC4nibeNSsSWD6dUd8yRwhwKOft87zpwsBj2huz1i0xdEnzZ7gCv9tepIhkZG01b3</BICARBONATE_obsid_raw><BICARBONATE_eff_date>2021-02-06T18:00:00Z</BICARBONATE_eff_date></BIRCARBONATE_reads><eff_date21>2021-02-06</eff_date21><BICARBONATE_COL_3>Y</BICARBONATE_COL_3><BICARBONATE_det><BICARBONATE_3>20</BICARBONATE_3><BICARBONATE_UNIT>mmol/L</BICARBONATE_UNIT><BICARBONATE_REF_LOW>22</BICARBONATE_REF_LOW><BICARBONATE_REF_HIGH>29</BICARBONATE_REF_HIGH><BICARBONATE_OOR_CLIN_SIG/><BICARBONATE_AE_NOTE/><BICARBONATE_OBSID>eLC4nibeNSsSWD6dUd8yRwhwKOft87zpwsBj2huz1i0xdEnzZ7gCv9tepIhkZG01b3</BICARBONATE_OBSID>\
<BICARBONATE_3_comment oc:queryParent=\"BICARBONATE_3\"/><BICARBONATE_UNIT_comment oc:queryParent=\"BICARBONATE_UNIT\"/><BICARBONATE_REF_LOW_comment oc:queryParent=\"BICARBONATE_REF_LOW\"/><BICARBONATE_REF_HIGH_comment oc:queryParent=\"BICARBONATE_REF_HIGH\"/><BICARBONATE_OOR_CLIN_SIG_comment oc:queryParent=\"BICARBONATE_OOR_CLIN_SIG\"/><BICARBONATE_AE_NOTE_comment oc:queryParent=\"BICARBONATE_AE_NOTE\"/><BICARBONATE_OBSID_comment oc:queryParent=\"BICARBONATE_OBSID\"/></BICARBONATE_det><NOTE_BICARB/><POS_CULTURE_codes>test</POS_CULTURE_codes><POS_CULTURE_max>NaN</POS_CULTURE_max><POS_CULTURE_reads><POS_CULTURE_repkey/><POS_CULTURE_raw/><POS_CULTURE_unit_raw/><POS_CULTURE_ref_low_raw/><POS_CULTURE_ref_high_raw/><POS_CULTURE_obsid_raw/><POS_CULTURE_eff_date/></POS_CULTURE_reads><eff_date22/><POS_CULTURE_COL_3>N</POS_CULTURE_COL_3><POS_CULTURE_det><POS_CULTURE_3/><POS_CULTURE_UNIT/><POS_CULTURE_REF_LOW/><POS_CULTURE_REF_HIGH/><POS_CULTURE_OOR_CLIN_SIG/><POS_CULTURE_AE_NOTE/><POS_CULTURE_OBSID/><POS_CULTURE_3_comment oc:queryParent=\"POS_CULTURE_3\"/><POS_CULTURE_UNIT_comment oc:queryParent=\"POS_CULTURE_UNIT\"/><POS_CULTURE_REF_LOW_comment oc:queryParent=\"POS_CULTURE_REF_LOW\"/><POS_CULTURE_REF_HIGH_comment oc:queryParent=\"POS_CULTURE_REF_HIGH\"/><POS_CULTURE_OOR_CLIN_SIG_comment oc:queryParent=\"POS_CULTURE_OOR_CLIN_SIG\"/><POS_CULTURE_AE_NOTE_comment oc:queryParent=\"POS_CULTURE_AE_NOTE\"/><POS_CULTURE_OBSID_comment oc:queryParent=\"POS_CULTURE_OBSID\"/></POS_CULTURE_det><todays_date_comment oc:queryParent=\"todays_date\"/><eff_date1_comment oc:queryParent=\"eff_date1\"/><CREAT_COL_comment oc:queryParent=\"CREAT_COL\"/><NOTE_CREAT_comment oc:queryParent=\"NOTE_CREAT\"/><eff_date2_comment oc:queryParent=\"eff_date2\"/><ALT2_COL_comment oc:queryParent=\"ALT2_COL\"/><NOTE_ALT2_comment oc:queryParent=\"NOTE_ALT2\"/><eff_date3_comment oc:queryParent=\"eff_date3\"/><AST_COL_comment oc:queryParent=\"AST_COL\"/><NOTE_AST_comment oc:queryParent=\"NOTE_AST\"/><eff_date4_comment oc:queryParent=\"eff_date4\"/><BILIRUBIN_COL_comment oc:queryParent=\"BILIRUBIN_COL\"/><NOTE_BILIRUBIN_comment oc:queryParent=\"NOTE_BILIRUBIN\"/><eff_date5_comment oc:queryParent=\"eff_date5\"/><ALP_COL_comment oc:queryParent=\"ALP_COL\"/><NOTE_ALP_comment oc:queryParent=\"NOTE_ALP\"/><eff_date6_comment oc:queryParent=\"eff_date6\"/><PLATELETS_COL_comment oc:queryParent=\"PLATELETS_COL\"/><NOTE_PLATELETS_comment oc:queryParent=\"NOTE_PLATELETS\"/><eff_date7_comment oc:queryParent=\"eff_date7\"/><HEMATOCRIT_COL_comment oc:queryParent=\"HEMATOCRIT_COL\"/><NOTE_HEMATOCRIT_comment oc:queryParent=\"NOTE_HEMATOCRIT\"/><eff_date8_comment oc:queryParent=\"eff_date8\"/><HGB_COL_comment oc:queryParent=\"HGB_COL\"/><NOTE_HGB_comment oc:queryParent=\"NOTE_HGB\"/><eff_date9_comment oc:queryParent=\"eff_date9\"/><WBC_COL_comment oc:queryParent=\"WBC_COL\"/><NOTE_WBC_comment oc:queryParent=\"NOTE_WBC\"/><eff_date10_comment oc:queryParent=\"eff_date10\"/><ABS_NEUTROPHIL_COL_comment oc:queryParent=\"ABS_NEUTROPHIL_COL\"/><NOTE_ABS_NEUTROPHIL_comment oc:queryParent=\"NOTE_ABS_NEUTROPHIL\"/><eff_date11_comment oc:queryParent=\"eff_date11\"/><LYMPHOCYTE_COL_comment oc:queryParent=\"LYMPHOCYTE_COL\"/><NOTE_Lymphocyte_comment oc:queryParent=\"NOTE_Lymphocyte\"/><eff_date12_comment oc:queryParent=\"eff_date12\"/><INR_COL_comment oc:queryParent=\"INR_COL\"/><NOTE_INR_comment oc:queryParent=\"NOTE_INR\"/><eff_date13_comment oc:queryParent=\"eff_date13\"/><PTT_COL_3_comment oc:queryParent=\"PTT_COL_3\"/><NOTE_PTT_comment oc:queryParent=\"NOTE_PTT\"/><eff_date14_comment oc:queryParent=\"eff_date14\"/><DDIMER_COL_3_comment oc:queryParent=\"DDIMER_COL_3\"/><NOTE_DDIMER_comment oc:queryParent=\"NOTE_DDIMER\"/><eff_date15_comment oc:queryParent=\"eff_date15\"/><CRP_COL_3_comment oc:queryParent=\"CRP_COL_3\"/><NOTE_CRP_comment oc:queryParent=\"NOTE_CRP\"/><eff_date16_comment oc:queryParent=\"eff_date16\"/><BNP_COL_3_comment oc:queryParent=\"BNP_COL_3\"/><NOTE_BNP_comment oc:queryParent=\"NOTE_BNP\"/><eff_date17_comment oc:queryParent=\"eff_date17\"/><TROPONIN_I_COL_3_comment oc:queryParent=\"TROPONIN_I_COL_3\"/><NOTE_T2_comment oc:queryParent=\"NOTE_T2\"/><eff_date18_comment oc:queryParent=\"eff_date18\"/><TROPONIN_T_COL_3_comment oc:queryParent=\"TROPONIN_T_COL_3\"/><NOTE_T3_comment oc:queryParent=\"NOTE_T3\"/><eff_date19_comment oc:queryParent=\"eff_date19\"/><TROPONIN_I_HS_COL_3_comment oc:queryParent=\"TROPONIN_I_HS_COL_3\"/><NOTE_T4_comment oc:queryParent=\"NOTE_T4\"/><eff_date20_comment oc:queryParent=\"eff_date20\"/><TROPONIN_T_HS_COL_3_comment oc:queryParent=\"TROPONIN_T_HS_COL_3\"/><NOTE_T5_comment oc:queryParent=\"NOTE_T5\"/><eff_date21_comment oc:queryParent=\"eff_date21\"/><BICARBONATE_COL_3_comment oc:queryParent=\"BICARBONATE_COL_3\"/><NOTE_BICARB_comment oc:queryParent=\"NOTE_BICARB\"/><eff_date22_comment oc:queryParent=\"eff_date22\"/><POS_CULTURE_COL_3_comment oc:queryParent=\"POS_CULTURE_COL_3\"/></LB><meta><instanceID>uuid:4a251e89-95b2-49cf-a6df-a6a552c4ee3d</instanceID></meta></data>"

TIMEFORMAT='It took %R seconds.'

time {
    for i in {1..16}
        do
            curl --user enketorules: -d "server_url=http://localhost:3000&form_id=LabsReconciliation&ecid=a&instance=${INSTANCE}&instance_id={$i}a" http://localhost:8005/oc/api/v1/instance/headless &
            pids[${i}]=$!
        done

    for pid in ${pids[*]}
        do
            wait $pid
        done
}

16 commands:

baseline with max processes 1: 30.928, 32.307, 30.725
baseline with max processes 2: 33.072, 30.918, 30.104
baseline with max processes 8: 33.479, 33.456, 31.531

24 commands

baseline with max processes 1: failures
baseline with max processes 2:
baseline with max processes 8: failures

Interesting findings so far:

  • when reducing "max processes", it takes the same amount of time, but the fewer CPU processes are working harder (from 2 to 1 processes: %CPU in Mac is twice as high). I cannot detect any advantage of increasing the number of processes actually. In the baseline situation, it makes it slightly slower in fact. It looks like this means that this operation isn't CPU bound: https://stackoverflow.com/a/28737438
  • when increasing the above script to a loop of 32 (or 16) commands and 8 processes, there are lots of error (timeout) responses. However, when running the script 16 times with 1 process, it runs fine and takes just as long (maybe a little faster!?)
  • I see all the individual Chromium processes starting up in Activity Monitor - 1 per command
  • share browser, use multiple pages. Is a mechanism needed to re-spawn a browser if it is killed for some reason?

Quick and dirty check: looks like the max improvement over the baseline is about 7 seconds (21% faster). For both 1 and 8 max processes. Oddly, the same amount of Chromium processes are shown in Activity Monitor.

Note that a browser will be launched for each 'process' set in config.json. Maybe that's the reason fewer processes are faster?

  • re-use same page - seems complex to make sure page is not in use, and to close page after period of non-use, - I implemented this without cache cleanup and concluded there was no improvement
  • do not load images, fonts etc
  • disable browser features that are not needed - did not find any improvements
  • cache resources (js, ) by providing userDataDir - small impact locally, BUT ON PRODUCTION SERVER MAY BE more SIGNIFICANT
  • undo previous CSS exclusion (as we have a better way to do this) - actually we can leave that as it excludes inline styles too
  • run benchmark with larger number of commands (I suspect the % improvement will be higher) - not done, because caching has no meaningful impact
  • How can OC figure out the optimum request rate?

For me locally sending 32 requests fails miserably. Sending 16 or 8 works fine. The latter actually takes a little less than half the time. So it may be smart to send small batches sequentially. I tried to find the optimum batch size. It seems to be 8 on my local Mac with 4 cores (11.9 seconds) (though a batch size of 4 is only very slightly slower per request). It has 8 threads but only 4 seem to hit. So a batch of twice the number of cores?

Screen Shot 2022-08-08 at 3 47 41 PM

Summary:

  1. code improvements make headless requests a bit faster ~ 20% in test form
  2. increasing the 'max processes' setting value makes headless requests slightly slower - a setting of 1 seems the fastest1
  3. regardless of the 'max processes' setting value, all cores seem to get used
  4. requests batch size of twice the number of cores (not threads) might be most efficient

Footnotes

  1. for headless requests - I didn't check other requests

rebase with latest master and let OC test from branch

  • do final check and create PR to merge into master - actually it was already merged in master for headless sessions. I've refactored it and copied the same approach for PDF generation.