Skip to content

Issue 424 - fhir-model perf tweaks and benchmarking#429

Merged
lmsurpre merged 6 commits intomasterfrom
issue-424
Nov 20, 2019
Merged

Issue 424 - fhir-model perf tweaks and benchmarking#429
lmsurpre merged 6 commits intomasterfrom
issue-424

Conversation

@lmsurpre
Copy link
Copy Markdown
Member

fhir-benchmark and related edits

  1. introduced run options under FHIRBenchmarkRunner for setting JMH
    params instead of passing via system properties

  2. refactored FHIRParserBenchmark to use JMH params

  3. introduced LargeValueSetCreator under fhir-examples-generator and
    specific examples for json and xml

  4. added FHIRValueSetBenchmarks for measuring ValueSet parse times

  5. added LargeValueSetCreator variants for creating HashSet and text
    file equivalents, and added Benchmarks for measuring parse times for
    those as well

fhir-model perf tweaks

  1. Code subtypes now use their builders for static initialization and
    static of helpers just return one of these constants. This avoids
    unneccessarilly constructing new instances which carries a slight
    validation cost.

  2. String, Uri, and certain String/Uri subtypes now use java-based
    validation from ValidationSupport instead of regex / pattern matching

For an overview of the test results, please see issue #424. On my local system, performance improved about 20% while loading a large valueset of Strings, Codes, and Uris. Unfortunately, overall parsing performance seems to be about the same (at least for the spec examples).

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Replaced regexes with hand-crafted loops based on
hot spots identified by the StackProfiler during parsing of a large
valueSet.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. introduced run options under FHIRBenchmarkRunner for setting JMH
params instead of passing via system properties

2. refactored FHIRParserBenchmark to use JMH params

3. introduced LargeValueSetCreator under fhir-examples-generator and
specific examples for json and xml

4. added FHIRValueSetBenchmarks for measuring ValueSet parse times

5. added LargeValueSetCreator variants for creating HashSet and text
file equivalents, and added Benchmarks for measuring parse times for
those as well

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. Code subtypes now use their builders for static initialization and
static `of` helpers just return one of these constants.  This avoids
unneccessarilly constructing new instances which carries a slight
validation cost.

2. String, Uri, and certain String/Uri subtypes now use java-based
validation from ValidationSupport instead of regex / pattern matching

Lock in the model updates by updating CodeGenerator.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre lmsurpre requested a review from JohnTimm November 19, 2019 01:39
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre lmsurpre changed the title Issue 424 - Issue 424 - fhir-model perf tweaks and benchmarking Nov 19, 2019
1. use `ValueSet.from` instead of `ValueSet.valueOf` which only works
with the ValueSet.name filed (e.g. ADDRESS vs Address)

2. fix FHIRGeneratorBenchmark to match FHIRParserBenchmark

3. if we get an unexpected ValueSet in the `of` static factory helper,
throw IllegalStateException instead of IllegalArgumentException since we
should never get there unless someone hand-edits the generated class

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

@JohnTimm JohnTimm left a comment

Choose a reason for hiding this comment

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

LGTM

@lmsurpre lmsurpre merged commit 0f41463 into master Nov 20, 2019
@lmsurpre lmsurpre deleted the issue-424 branch November 20, 2019 14:56
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.

2 participants