forked from igrigorik/vimgolf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include position in ranking for each challenge in user page
Additionally to showing the best player score and the best score for the challenge, include the actual position of the best user score in the ranking for that particular challenge. Benchmarking: Created db:setup with challenges=300 users=10000, patched db/seeds.db to have most challenges have a random number of entries in the range 100..2,000, but 2% of them in the range 5,000..40,000, to provide a more realist test scenario. (Creating all challenges with 20,000 entries just made all queries too expensive from the start.) With that setup, I measured the effects of loading a user page, for a user with entries in 36 challenges, which included all 6 challenges with over 5,000 entries. More specifically, the 6 top challenges ranged from 17,829 to 37,251 entries. I then loaded this page 10 times, with and without the changes in this PR. I took the average and standard deviation of the 10 measurements for each situation. - Without this PR: 0.25547s ± 0.00663s - With this PR: 2.23918s ± 0.05312s This is a roughly 9x increase, which is perhaps quite expensive to make it acceptable, even though the feature itself is very nice.
- Loading branch information
1 parent
dd31c71
commit 6cabc81
Showing
3 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters