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?