[Dev] Small tweak to parcel loader

Andi Vajda vajda at osafoundation.org
Fri Jun 11 11:05:25 PDT 2004


> A question I have for Andi is: "what is more efficient (in terms of
> time): looking up the value of an attribute that has been given an
> initialValue, or a defaultValue?"  Potentially, retrieving a
> defaultValue means there's an extra place to go look for a value (but I
> haven't checked the code yet to see how this works).

The trade-off is space vs speed. The defaultValue is owned by the attribute
item, not the item. The initialValue is copied onto the item during item
construction. The defaultValue is schema-owned, the initialValue is copied and
that copy is item-owned.
Looking up a defaultValue is more costly since it has to be fetched from
schema everytime.
Another difference is that a defaultValue that can be modified in place, such
as a collection, lob or struct, is marked read-only since modifying a
defaultValue affects all items that share it.

Andi..


More information about the Dev mailing list