Significantly improve leaderboard performance#406
Merged
danlamanna merged 1 commit intomasterfrom Oct 29, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the leaderboard query performance by replacing ORM object fetching with dictionary-based queries using .values() and switching from the standard library json module to the faster orjson library.
- Replaces ORM model queries with
.values()to return dictionaries instead of model instances - Adds
orjsondependency for faster JSON serialization - Updates templates and tests to access dictionary keys instead of object attributes
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| stade/core/views.py | Optimizes leaderboard query to use .values() for dictionary output; implements manuscript URL generation using S3FileField; switches to orjson for JSON serialization |
| stade/core/tests/test_leaderboard.py | Updates test assertions to access dictionary keys instead of object attributes |
| stade/core/templates/leaderboards.html | Updates template to use dictionary key syntax for submission data |
| setup.py | Adds orjson dependency |
| requirements.txt | Pins orjson version to 3.11.4 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e805ae9 to
ff32788
Compare
ff32788 to
1ccd99f
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.