Skip to content

Why string keys are not compresed? #341

@yves-chevallier

Description

@yves-chevallier

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions