Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: cache missing XBlock mappings in load_class
Checking the entrypoints for the XBlock class we want for a given tag name is relatively expensive. We mitigate this by caching the mapping of tags to classes in Plugin.load_class(). But before this commit, we weren't caching failed lookups, i.e. the situation where there is no XBlock that maps to a given tag. This meant that if a course had many instances of a type of XBlock that is not installed on the given server, we would be constantly scanning entrypoints to look for our non-existent XBlock subclass. This really slows down things like the Studio course outline page. The fix here is to store failed lookups as None values in the PLUGIN_CACHE.
- Loading branch information