Advantages: * Owned BSONObj now uses 1 heap allocation rather than 3 * sizeof(BSONObj) is now 16 rather than 24 (on 64 bit) * perftest bson shows it to be much faster Change in BSONObj constructor API for owned case to make sure old code gets updated to allocate room for the ref count. Anyone using BSONObjBuilder doesn't need to worry about this change.
17 KiB
17 KiB