Open AlexanderColen opened 4 years ago
Two potential bottlenecks, most likely a combination of the two in the end.
Iterating over the lists multiple times, can probably be done more simply. https://github.com/AlexanderColen/Annie-May-Discord-Bot/blob/a22aada92e2cda6208f84f5a79245f1565245e40/Annie/Utility/AffinityUtility.cs#L31-L40 4 GraphQL queries per user really hurts performance the more users are in the server. Quick fix is to move the original user out of this method, which already cuts it down to half. https://github.com/AlexanderColen/Annie-May-Discord-Bot/blob/a22aada92e2cda6208f84f5a79245f1565245e40/Annie/Modules/AffinityModule.cs#L46-L49
Two potential bottlenecks, most likely a combination of the two in the end.
Iterating over the lists multiple times, can probably be done more simply. https://github.com/AlexanderColen/Annie-May-Discord-Bot/blob/a22aada92e2cda6208f84f5a79245f1565245e40/Annie/Utility/AffinityUtility.cs#L31-L40 4 GraphQL queries per user really hurts performance the more users are in the server. Quick fix is to move the original user out of this method, which already cuts it down to half. https://github.com/AlexanderColen/Annie-May-Discord-Bot/blob/a22aada92e2cda6208f84f5a79245f1565245e40/Annie/Modules/AffinityModule.cs#L46-L49