Commit 4ecac958 authored by Jack Koenig's avatar Jack Koenig
Browse files

Change mustClone calculation to use _minId

Previously it used a calculation of whether a given Record (or Bundle)
contained an "external reference", defined as any element with an _id
less than the _id of the Record. This does not work for certain cases
because it is not recursive and a child Record could itself contain an
external reference. Changing the calculation to be recursive negates
much of the benefit because many cases that should not need to clone end
up cloning.

The new algorithm instead uses a notion of "minimum id" for a Data. For
most Data, this is just _id, but for Records, it is the minimum id of
any of its children (recursively). This does replace the previous 1-byte
memoized field with an 8-byte field, but this algorithm works better and
should result in more savings from lazy cloning.
parent 87fd9c11
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment