-
Which compressor do I need? I'm trying to implement uWebSockets connector to graphql-ws package. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My opinion is that compression is solving a symptom of having an inefficient application protocol. By using binary, dense protocols such as ProtoBuf or similar, instead of sparse text protocols with repeating key strings like JSON you can eliminate the need for compression altogether. But for JSON, you probably want something like DEDICATED_COMPRESSOR_4KB as it has the advantage of only adding 4kb memory usage per connection, while still having a decently sized sliding window. But again, a lot of optimizations can be made if you skip compression and use a binary protocol tailored for minimal redundancy. |
Beta Was this translation helpful? Give feedback.
My opinion is that compression is solving a symptom of having an inefficient application protocol. By using binary, dense protocols such as ProtoBuf or similar, instead of sparse text protocols with repeating key strings like JSON you can eliminate the need for compression altogether.
But for JSON, you probably want something like DEDICATED_COMPRESSOR_4KB as it has the advantage of only adding 4kb memory usage per connection, while still having a decently sized sliding window.
But again, a lot of optimizations can be made if you skip compression and use a binary protocol tailored for minimal redundancy.