-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1869: Course program api performance improvements #1872
1869: Course program api performance improvements #1872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I did see performance improvement with courses/programs/course_runs APIs, I didn't notice any other issues.
courses/serializers.py
Outdated
class DepartmentSerializer(serializers.ModelSerializer): | ||
"""Department model serializer""" | ||
|
||
name = CharField(max_length=128) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line isn't needed as its a standard model field that included in serializer meta field list
This reverts commit f16b217.
What are the relevant tickets?
#1869
Description (What does it do?)
Improves the performance of courses REST APIs with the following changes:
live
attribute as an index field on the Program and Course models.How can this be tested?
main
branch, and that all data expected is provided in the results.Additional Context
Testing results
Testing was performed via GET requests using Postman. The database records used for testing may not be extensive and do not contain all possible related records, such as a course, product, flexible price record, and flexible price request.
Recorded times indicate the lowest response time achieved for each set of GET requests for REST endpoint. The set of GET requests was roughly 5-10 requests performed immediately after each other.
/courses
(32 records)-- Before -------
9.24s
-- Now -------
516ms
/courses?id=4&live=true
(32 records)-- Before ------- (filtering by readable_id)
78ms
-- Now -------
42ms
/programs?live=true
(1 record)http://mitxonline.odl.local:8013/api/programs?live=true
-- Before -------
113ms
-- Now -------
49ms
/course_runs
(31 records)http://mitxonline.odl.local:8013/api/course_runs
-- Time Before -------
896ms
-- Time Now -------
672ms