Сообщение Re: JSON vs BSON: очередное торжество больного воображения и от 14.03.2023 14:01
Изменено 14.03.2023 16:32 DiPaolo
Иначе говоря, назначение и особенности BSON описаны тут: https://bsonspec.org/faq.html:
What is the point of BSON when it is no smaller than JSON in some cases?
BSON is designed to be efficient in space, but in some cases is not much more efficient than JSON. In some cases BSON uses even more space than JSON. The reason for this is another of the BSON design goals: traversability. BSON adds some "extra" information to documents, like length of strings and subobjects. This makes traversal faster.
BSON is also designed to be fast to encode and decode. For example, integers are stored as 32 (or 64) bit integers, so they don't need to be parsed to and from text. This uses more space than JSON for small integers, but is much faster to parse.
Все просто, кратко и понятно ИМХО.
Иначе говоря, назначение и особенности BSON описаны тут: https://bsonspec.org/faq.html:
What is the point of BSON when it is no smaller than JSON in some cases?
BSON is designed to be efficient in space, but in some cases is not much more efficient than JSON. In some cases BSON uses even more space than JSON. The reason for this is another of the BSON design goals: traversability. BSON adds some "extra" information to documents, like length of strings and subobjects. This makes traversal faster.
BSON is also designed to be fast to encode and decode. For example, integers are stored as 32 (or 64) bit integers, so they don't need to be parsed to and from text. This uses more space than JSON for small integers, but is much faster to parse.
Все просто, кратко и понятно ИМХО.