discord.js
discord.js copied to clipboard
@discordjs/ws erlpack encoding support
Which package is the feature request for?
ws
Feature
Erlpack was not added on @discordjs/ws
and the only encoding option is json
with no support for etf
Ideal solution or implementation
Implement erlpack encoding that is similar to the old websocket code, with the option to fallback to json for those who can't install it
Alternative solutions or implementations
No response
Other context
Been using erlpack for a long time now and using it gave me a lot of performance benefits over the years I used it. Would be nice to add support for it as well on @discordjs/ws
We've explicitly opted against implementing it due to concerns with the erlpack lib that Discord offers. If a better alternative were to arise, we're more than willing to implement it.
We've explicitly opted against implementing it due to concerns with the erlpack lib that Discord offers. If a better alternative were to arise, we're more than willing to implement it.
If that's the case, then should d.js just develop or fork their own erlpack and fix the concerns they have over the Discord provided erlpack lib? Since the performance increase on using erlpack is really noticeable and would help us to deploy less threads due to lower cpu usage on decoding / encoding
Not only do I think there's no one willing to do it, there's always the concern that if someone does it no one else will have a clue how to maintain it, making it dependant on that one person.
What concerns do d.js have on the current erlpack provided by Discord that makes it not feasible right now
We've explicitly opted against implementing it due to concerns with the erlpack lib that Discord offers. If a better alternative were to arise, we're more than willing to implement it.
what would be those concerns and what would be the requirements for a better alternative? I have implemented an ETF encoder/decoder in pure js for my library, i wouldn't mind making it available as a separate package and, if need be, modifying it to comply with your requirements if you guys are interested.
according to discord staff (ian 2) erlpack isn't really needed anymore
Realistically, if you care about ws performance, installing the 3 recommended optional packages would give a noticeable performance increase! It's one of the main reason I leaned against implementing etf support when we (or well, DD made) /ws.
As stated, we don't intend to support erlpack in the near future.