You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calculating ratings for 10s or 100s of results in a rating period, performance is acceptable, but if there are thousands or more, some issues in the implementation can cause the updateRatings method to perform very slowly.
A few issues are:
getResults(player) iterates over the whole list of results to get the filtered list, when there are a lot of results this can be slow
There are two separate calls to getResults(player), one to check if empty then another to get the list to iterate over
The above is done N times, once for each player
The result is a 2N^2 number of executions which gets really slow.
The participants is also semi-dynamic in that it iterates over all the results to make sure all players are populated.
The second issue isn't that severe, one solution would be to update the participants set as results are added, which isn't really different than iterating over the results once, but as written calling getParticipants twice will iterate every time.
The first issue is the severe one and could be solved by keeping a list of results for each player in a map so it can simply be retrieved and not dynamically determined.
The text was updated successfully, but these errors were encountered:
When calculating ratings for 10s or 100s of results in a rating period, performance is acceptable, but if there are thousands or more, some issues in the implementation can cause the updateRatings method to perform very slowly.
A few issues are:
The result is a 2N^2 number of executions which gets really slow.
The participants is also semi-dynamic in that it iterates over all the results to make sure all players are populated.
The second issue isn't that severe, one solution would be to update the participants set as results are added, which isn't really different than iterating over the results once, but as written calling getParticipants twice will iterate every time.
The first issue is the severe one and could be solved by keeping a list of results for each player in a map so it can simply be retrieved and not dynamically determined.
The text was updated successfully, but these errors were encountered: