-
-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Binary websocket traffic #341
Comments
This is difficult to implement with the library we are currently using. I'm not aware of a JVM library that takes both JSON and BSON. The performance overhead is likely negligible. |
it should be possible with kotlinx.serialization, so this might be possible with not that much effort |
In addition to the methods described above, this feature can be implement by using https://github.com/FasterXML/jackson-datatypes-misc in the current implementation. (without major code refactoring) Additional comment: BSON is inefficient compared to other binary data format. |
I am still not convinced that this is an optimization that is worth bothering with. The transmission of WebSocket events is magnitudes smaller than all the other network traffic that Lavalink does |
Hi,
my personal usecase is that I want to encode JSON more efficiently in Python to send it over the websocket and one of the best ways is to use alternate JSON encoders like orjson which encode to bytes instead of strings. Decoding those to strings before sending them over the websocket connection feels like an unnecessary overhead.
Current, Lavalink rejects any binary websocket traffic, so I am wondering if it would be possible to add support for it. From what I've experienced in languages such as Rust or Python, JSON decoding from bytes can also be more efficient than from strings, so it might be a beneficial addition on both sides. Either way I imagine this to be easy to implement and one of the small things that can make a nice difference.
The text was updated successfully, but these errors were encountered: