4 ms·
for (let i = 0; i < 1024 * 1024; i++) { buf += Math.random() > 0.5 ? "{" : "}"; } Your sample data is bunk for determining the compression characteristics of b
by forgottenpass 11y ago
for (let i = 0; i < 1024 * 1024; i++) { buf += Math.random() > 0.5 ? "{" : "}"; }
Your sample data is bunk for determining the compression characteristics of braces in a realistic json file.
- ggreer 11y agoThe point was to show that compression works at the level of bits, not characters. Realistic JSON is mostly content, which means your compression ratio depends more on content redundancies than braces or quotes. So too for binary serialization formats.