You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to send pre-compressed data? i.e. if one caches messages one could cache the compressed version in order to avoid compressing during every send?
e.g.
Instead of:
cache.set(key,buf)// ...for(constsocketofsockets)(socket.send(cache.get(key))// compressed by uws}
Yes it is possible. It was the behaviour in v0.14. But doing more investigation I found that, this was very poor for both compressive performance, and for CPU performance.
My first idea was that sharing a compressor would be best, but the cost of compressing is directly (linearly) correlated with the difference from what you have in your sliding window and what you are compressing.
This means that dedicated (per connection) compression is both faster and obviously compresses better.
If the difference is minimal, compression costs almost nothing. If the difference is total, it's slow as a snail.
Most who use compression prefers the dedicated compression. So the shared pub sub compression was removed (because of complexity and added work of keeping multiple variants of the outgoing data).
Adding something like a shared compressor (only) for pub sub is most likely doable
Would it be possible to send pre-compressed data? i.e. if one caches messages one could cache the compressed version in order to avoid compressing during every send?
e.g.
Instead of:
This would enable 2 things:
The text was updated successfully, but these errors were encountered: