AznStevy / Maybe-Useful-Cogs

Random cogs for a discord bot.
MIT License
29 stars 31 forks source link

Calculating leader board takes a long time on big servers #61

Open travisgroth opened 6 years ago

travisgroth commented 6 years ago

Hi - We've found that on servers with very large user populations, calculating 'top' can be extremely expensive as _required_exp() is built up in a loop for each level for each user. Run time with about 30k users is just under 5 minutes. We're on older code (pre-mongo) but the level->exp calculation implementation hasn't changed much from what I can tell.

Opened #60 to fix.