Skip to content
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

perf: reduce stackedmodelconfig queries #36133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ormsbee
Copy link
Contributor

@ormsbee ormsbee commented Jan 18, 2025

TieredCache is a hybrid request cache + regular cache, where we check
against a Django cache for the first get, but then store that data in a
process-local request cache. ConfigurationModels were already converted
to use TieredCache for performance reasons, but we never converted the
StackedConfigurationModel subclass.

This can reduce the lookups for ContentTypeGatingConfig by hundreds of
network cache calls in a given request (depending on how many exams are
in a course).

This also affects the following subclasses of StackedConfigurationModel,
though I have not measured the precise effects:

* CourseDurationLimitConfig
* DisableProgressPageStackedConfig
* DiscountRestrictionConfig
* DiscountPercentageConfig
* ProviderFilter (for dicusssions providers)
* SelfPacedRelativeDatesConfig

@ormsbee ormsbee changed the title perf reduce stackedmodelconfig queries perf: reduce stackedmodelconfig queries Jan 18, 2025
@ormsbee ormsbee force-pushed the perf-reduce-stackedmodelconfig-queries branch from 5cfca43 to 1d32019 Compare January 18, 2025 17:48
@ormsbee ormsbee added the performance Relates to improving latency/throughput or reducing resource usage label Jan 18, 2025
TieredCache is a hybrid request cache + regular cache, where we check
against a Django cache for the first get, but then store that data in a
process-local request cache. ConfigurationModels were already converted
to use TieredCache for performance reasons, but we never converted the
StackedConfigurationModel subclass.

This can reduce the lookups for ContentTypeGatingConfig by hundreds of
network cache calls in a given request (depending on how many exams are
in a course).

This also affects the following subclasses of StackedConfigurationModel,
though I have not measured the precise effects:

* CourseDurationLimitConfig
* DisableProgressPageStackedConfig
* DiscountRestrictionConfig
* DiscountPercentageConfig
* ProviderFilter (for dicusssions providers)
* SelfPacedRelativeDatesConfig
@ormsbee ormsbee force-pushed the perf-reduce-stackedmodelconfig-queries branch from 1d32019 to cacf861 Compare January 18, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Relates to improving latency/throughput or reducing resource usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant