Currently Metadata::metadata_size serializes everything to get it's byte size. It was done this way for simplicity at the cost of performance. It'd be great to get some book-keeping in place so that changes to metadata (adding, removing, updating atoms) performs minimal calculations at time of edit to allow the serialized byte size to always be known (including if it's a 64bit or 32bit variant of the atom, e.g. chunk offsets).
Currently
Metadata::metadata_sizeserializes everything to get it's byte size. It was done this way for simplicity at the cost of performance. It'd be great to get some book-keeping in place so that changes to metadata (adding, removing, updating atoms) performs minimal calculations at time of edit to allow the serialized byte size to always be known (including if it's a 64bit or 32bit variant of the atom, e.g. chunk offsets).