discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

@discordjs/ws erlpack encoding support

Open Deivu opened this issue 2 years ago • 7 comments

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

Deivu avatar Jan 17 '23 18:01 Deivu

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.

didinele avatar Jan 17 '23 18:01 didinele

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

Deivu avatar Jan 18 '23 12:01 Deivu

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.

didinele avatar Jan 18 '23 13:01 didinele

What concerns do d.js have on the current erlpack provided by Discord that makes it not feasible right now

Deivu avatar Jan 18 '23 14:01 Deivu

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.

timotejroiko avatar Feb 01 '23 21:02 timotejroiko

according to discord staff (ian 2) erlpack isn't really needed anymore

Screenshot_20230321-084829_Discord.jpg

SuperchupuDev avatar Mar 21 '23 08:03 SuperchupuDev

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.

vladfrangu avatar Mar 21 '23 09:03 vladfrangu

As stated, we don't intend to support erlpack in the near future.

didinele avatar Jul 06 '24 10:07 didinele