Why is the size encoded for a compound (list, map) and array types?
I don’t find it very useful to encode the size for compound (list, map) and array types while it adds a bit more work in encoding. Before writing the count and the items into the buffer, the encoder has to do a first pass to calculate the size of the type. But the decoder does not need the size information to decode the type, since the count is in the buffer and all items are prefixed with format codes. If the size information is meant for buffer boundary check, the same can be achieved because the frame size is known and the decoder knows which type is being decoded.