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
Please register or sign in to comment