Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf improvement - guard FHIRPath evaluation during search interaction #2962

Merged
merged 2 commits into from
Nov 29, 2021

Conversation

lmsurpre
Copy link
Member

@lmsurpre lmsurpre commented Nov 9, 2021

FHIRRestHelper.performSearchReferenceChecks showed up as a hot spot on a
recent profiling exercise. I think we can add some simple checks to
avoid most of the work in this method for most cases, so I prototyped
that here.

Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com

Copy link
Contributor

@michaelwschroeder michaelwschroeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

FHIRRestHelper.performSearchReferenceChecks showed up as a hot spot on a
recent profiling exercise.  I think we can add some simple checks to
avoid most of the work in this method for most cases, so I prototyped
that here.  Needs evaluation.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
…per.java


Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@punktilious
Copy link
Collaborator

After loading a million resources, we get:

(777.6332902081382 - 743.5542270821063) / 743.5542270821063 * 100 = 4.58% improvement

This is a good improvement for a single, relatively small change.

Test: pg-load-synthea.sh
Baseline 4.10.1:

fhirdb=> SELECT count(*) AS total,
       count(*) / EXTRACT(EPOCH FROM max(lr.created_tstamp) - min(lr.created_tstamp)) AS rate
  FROM fhirbucket.logical_resources lr,
     fhirbucket.resource_bundle_loads bl
 WHERE lr.resource_bundle_load_id = bl.resource_bundle_load_id
   AND bl.loader_instance_id = (select max(loader_instance_id) FROM fhirbucket.loader_instances);
  total  |       rate 
---------+-------------------
 1013349 | 743.5542270821063


# With new FHIRRestHelper.performSearchReferenceChecks
fhirdb=> SELECT count(*) AS total,
       count(*) / EXTRACT(EPOCH FROM max(lr.created_tstamp) - min(lr.created_tstamp)) AS rate
  FROM fhirbucket.logical_resources lr,
     fhirbucket.resource_bundle_loads bl
 WHERE lr.resource_bundle_load_id = bl.resource_bundle_load_id
   AND bl.loader_instance_id = (select max(loader_instance_id) FROM fhirbucket.loader_instances);
  total  |       rate
---------+-------------------
 1079168 | 777.6332902081382

@lmsurpre lmsurpre changed the title Perf experiment - guard FHIRPath evaluation during search interaction Perf improvement - guard FHIRPath evaluation during search interaction Nov 29, 2021
@lmsurpre lmsurpre merged commit 9dd0b16 into main Nov 29, 2021
@lmsurpre lmsurpre deleted the lee-main branch November 29, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants