Skip to content
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

Improved max_concurrency aware ShardManager #1370

Merged
merged 5 commits into from
Jun 2, 2022

Conversation

HcgRandon
Copy link
Contributor

@HcgRandon HcgRandon commented May 6, 2022

This PR makes ShardManager max_concurrency aware. Shards in different rate_limit_key (https://discord.com/developers/docs/topics/gateway#sharding-max-concurrency) buckets start in parallel resulting in significantly faster startup times across the board for large scale discord bots. Here is a table (these were tested from intent enabled tokens):

Old time New Time concur % faster shards/total other
224.251s 68.312s 16 ~69.5% (nice) 16/1024 getAllUsers: true
431.849s 70.237s 16 ~83.7% 32/1024 getAllUsers: false
79.591s 76.640s 1 margin of err 16/16 getAllUsers: false

lib/gateway/ShardManager.js Outdated Show resolved Hide resolved
DonovanDMC
DonovanDMC previously approved these changes May 6, 2022
@DonovanDMC DonovanDMC merged commit 36e7a76 into abalabahaha:dev Jun 2, 2022
DonovanDMC added a commit to DonovanArchive/ErisPRUpdateBot that referenced this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants