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

Intern Uri, Canonical, Code, Coding and CodeableConcept #628

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

alexanderkiel
Copy link
Member

@alexanderkiel alexanderkiel commented Feb 27, 2022

In FHIR, some values repeat in many resources. First uri's are used as system's in Codings and Identifiers. Second canonical values are used to refer to other resources. Third codes are often the same for a large number of resources. Last, Coding and CodeableConcept contain system and code values and are also often the same in it's entirety.

By interning instances of those values, only one instance will resist in memory as opposed to many. Because all values are immutable, there is no risk in sharing instances. The memory savings are about 50 % for Synthea BMI Observations.

@alexanderkiel alexanderkiel self-assigned this Feb 27, 2022
@codecov
Copy link

codecov bot commented Feb 27, 2022

Codecov Report

Merging #628 (ac4edd1) into develop (88ecae7) will increase coverage by 0.00%.
The diff coverage is 92.20%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #628   +/-   ##
========================================
  Coverage    93.42%   93.42%           
========================================
  Files          235      236    +1     
  Lines        13875    13911   +36     
  Branches       343      343           
========================================
+ Hits         12963    12997   +34     
- Misses         569      571    +2     
  Partials       343      343           
Impacted Files Coverage Δ
modules/rest-util/src/blaze/handler/util.clj 70.67% <0.00%> (ø)
...fhir-structure/src/blaze/fhir/spec/impl/intern.clj 90.00% <90.00%> (ø)
...odules/fhir-structure/src/blaze/fhir/spec/impl.clj 95.55% <100.00%> (+0.03%) ⬆️
...odules/fhir-structure/src/blaze/fhir/spec/type.clj 92.93% <100.00%> (+0.12%) ⬆️
...raction/src/blaze/interaction/history/instance.clj 97.77% <100.00%> (ø)
...teraction/src/blaze/interaction/history/system.clj 100.00% <100.00%> (ø)
...interaction/src/blaze/interaction/history/type.clj 92.85% <100.00%> (ø)
...interaction/src/blaze/interaction/history/util.clj 100.00% <100.00%> (ø)
.../interaction/src/blaze/interaction/search/util.clj 100.00% <100.00%> (ø)
...ction/src/blaze/interaction/search_compartment.clj 93.47% <100.00%> (ø)
... and 9 more

@alexanderkiel alexanderkiel force-pushed the intern-uri branch 2 times, most recently from 9cda0e1 to 6b98bca Compare February 28, 2022 08:18
In FHIR, some values repeat in many resources. First uri's are used as
system's in Codings and Identifiers. Second canonical values are used to
refer to other resources. Third codes are often the same for a large
number of resources. Last, Coding and CodeableConcept contain system and
code values and are also often the same in it's entirety.

By interning instances of those values, only one instance will resist in
memory as opposed to many. Because all values are immutable, there is no
risk in sharing instances. The memory savings are about 50 % for Synthea
BMI Observations.
@alexanderkiel alexanderkiel changed the title Intern Uri Intern Uri, Canonical, Code, Coding and CodeableConcept Feb 28, 2022
@alexanderkiel alexanderkiel merged commit 8202bd2 into develop Feb 28, 2022
@alexanderkiel alexanderkiel deleted the intern-uri branch February 28, 2022 15:01
@alexanderkiel alexanderkiel added this to the v0.16.1 milestone Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant