What are the pros and cons of using a Shared compressor, Dedicated compressor, or no compression? #646
Unanswered
dominicklee
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The compression options only control compression ratios. Messages will always be delivered verbatim no matter what options you use. Best is to test for yourself. 3kb is probably a good option for you but maybe disable compression if better? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the docs, there is an option of setting a Shared compressor, Dedicated compressor (with various sizes up to 256kb), and no compression. As mentioned in the docs: https://unetworking.github.io/uWebSockets.js/generated/index.html#SHARED_COMPRESSOR
Can someone explain when might a developer prefer using the Shared compressor? Also, in the event someone wants the Dedicated compressor, how would calculate the right balance between speed/CPU? If we run on a 2 CPU system with 4-6 GB RAM, what is ideal if we want to stream 255 byte data packets at 10 FPS?
What happens if someone chooses Dedicate compressor with 3kb (for example), but the data payload exceeds the 3kb buffer? From a technical standpoint, what happens when the data is received?
Of course, no compression simply means the library does not do anything to provide a buffer. But when might someone want to pick this over the other two?
Please kindly explain the advantages and tradeoffs of these options, and ideally an example of a use-case that might be appropriate for each. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions