Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Are there any tools for optimal data compression over multiple messages?
1 point by eeegnu on Aug 20, 2020 | hide | past | favorite | 1 comment
To clarify, consider that a single long message can efficiently and losslessly be compressed with methods such as a huffman encoding. But when sending many small messages, you may lose out on a broader encoding that both sides can use which would in the long pay off.

For example say that I know my application and the user should only ever communicate N different things, and one at a time. I could manually map each of these to an integer and only allow the payload to be an integer. But it feels like allot of extra work for something that could better just be built into the protocols configuration, and maybe set up by presenting it with a common usage list of your typical messages. Does something like this exist?



For mapping of commands to integers you can use commonly available serialization libraries and schemas. E.g. using protocol buffers you can describe all your datatypes as enums, and it will only send integers around.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: