Replies: 1 comment 1 reply
-
It's a very good question. Old (v19) versions used to have a special path for shared compressor where it compressed once. The idea was that, clearly it must be best. Problem is that it becomes complex when you have a mix of configurations but most importantly - Shared compression sucks. It really sucks. Performance cost of compressing a message is inversely proportional to how similar the new message is, from the history of previously compressed messages. Also the ratio of compression is better the more similar the new message is. With shared compression you essentially have 0 history and thus 0 similarity meaning maximum compression cost (CPU) and worst compression ratio. The performance cost of compresing a similar message is very small, while the cost of compressing a dissimilar message is so grand that it takes 90% of all overhead. It turned out that nobody seriously used shared compression but really only used a dedicated compressor per connection. So this "optimization" with a shared compressor was removed and the pub/sub simplified. Compression really is a duct tape kind of solution to a problem that could have been solved with a minimal protocol, but bloated JSON is standard in web, so we have to deal with it. And people tend to deal with it by enabling per-socket compressors. |
Beta Was this translation helpful? Give feedback.
-
Is it compressed only once or every time for each ws connection?
Beta Was this translation helpful? Give feedback.
All reactions