-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Option to skip utf-8 check #1924
Comments
I'm -1 because it is mandatory per specification and skipping it might lead to unexpected behavior. See #1868. |
Even if the utf8 check is voluntarily disabled because the developer is sure of the origin and the encoding? |
The spec does not say anything about that. You might trust a sever but I do not see a real need for the option. |
Usually an application does not open thousands of WebSocket connections to the same trusted server or set of servers, which is the only scenario I can think of where the option would be useful. |
Indeed, but for example, a bot, which obviously trusts the server, can receive a lot of messages, and can also have many connections. |
I'm not sure I understand, what would that bot do? |
A Discord bot for example. |
I don't know how a discord bot works but wouldn't it open a single (client) connection to a server? Why would it need more? |
When a Discord bot is on a large number of guilds (> 1000), we use the "sharding", this system allows to "divide" the bot in several parts (called shard), each one takes care of a chunk of guilds/events. Each shard is independent and has its own websocket connection. |
Ok but it seems an edge case and even if there is no limit I think the number of shards is usually in the order or tens? |
It can start from a few shards up to several thousands for big bots. |
Adding the option is easy but I want it to meet a real need/demand. The same argument made here for the client can also be done for the server if clients are trusted. If the option is added for the client, it should also be added for the server. I am personally not interested but let's keep this open for a few days to see if other people are interested in having this feature. |
Anyway does a shard run in its own process or do shards share the same process? |
In its own process. |
issue.
Description
I was wondering if it would be interesting to have an option (disabled by default) to skip the UTF-8 check. This would give a slight performance gain in my opinion. (Only for the client)
The text was updated successfully, but these errors were encountered: