A normal "array" object just writes each field one after the other. So we do not save on "default value" fields, be the code is simple and probably runs fast.
"Map" objects, OTOH, normally only write non-default value. Since MessagePack requires us to specify the size of an array/map/raw before creating it, we are required to go over the fields of a "map" object twice; Once to count how many fields are non-default, and once to actually write them. Given this knowledge, we can compute if the map-form, or the array form, uses less space. And so we might have objects that support both forms of serialisation, and chose the most optimal at runtime, before actually writing themselves.
A normal "array" object just writes each field one after the other. So we do not save on "default value" fields, be the code is simple and probably runs fast.
"Map" objects, OTOH, normally only write non-default value. Since MessagePack requires us to specify the size of an array/map/raw before creating it, we are required to go over the fields of a "map" object twice; Once to count how many fields are non-default, and once to actually write them. Given this knowledge, we can compute if the map-form, or the array form, uses less space. And so we might have objects that support both forms of serialisation, and chose the most optimal at runtime, before actually writing themselves.