Studies view can take a long time to load.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12
- Forks
- 21
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 5
Description
Description
The study view /exp/studies/<int:pk>/ is slow to load.
How to reproduce
Head to any to studies view and check the page load time.
Expected behavior
Generally, we'd want pages to load faster. Anything quicker is great, but something under 500ms would be amazing.
Additional context
I've tracked down the issue with two parts of this view's context:
- The function
self.request.user.perms_for_study(study)seems to take a fairly time. The permissions accumulation from lab to studies seems unnecessary. The solution might be to get the permission you need instead of getting all the permissions. - The
self.search_researchers()function (and its brother functionself.get_annotated_study_researchers()) can take a long time if the lab a many members. e.g. theSandbox labon staging. This might be best resolved loading this part of the page asynchronously.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the /exp/studies/<int:pk>/ study view and profile the perms_for_study(study), search_researchers(), and get_annotated_study_researchers() paths identified in the issue. Compare their contribution to page-load time, then verify that the study view loads substantially faster, with under 500ms as the stated target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100