Let's suppose I have this dataset:
{'data': [
{'foo': 42, 'bar': 23},
{'foo': 88, 'bar': 56},
{'foo': 4, 'bar': 8}
]}
I get this output:
>>> msgpack.dumps(d)
b'\x81\xa4data\x93\x82\xa3foo*\xa3bar\x17\x82\xa3fooX\xa3bar8\x82\xa3foo\x04\xa3bar\x08'
>>> len(msgpack.dumps(d))
40
The strings could be easily moved in a table to appear once. Is there a rationale for not doing this optimization?
Let's suppose I have this dataset:
{'data': [ {'foo': 42, 'bar': 23}, {'foo': 88, 'bar': 56}, {'foo': 4, 'bar': 8} ]}I get this output:
The strings could be easily moved in a table to appear once. Is there a rationale for not doing this optimization?