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
Displaying the project overview for large cohorts is slow #303
Comments
Root Cause Analysis
|
Resolution Proposal diff --git a/timeline/templatetags/timeline_tags.py b/timeline/templatetags/timeline_tags.py
index eae4b34..a5ccd32 100644
--- a/timeline/templatetags/timeline_tags.py
+++ b/timeline/templatetags/timeline_tags.py
@@ -1,3 +1,4 @@
+import itertools
import html
from django import template
@@ -46,9 +47,13 @@ def get_details_events(project, view_classified):
if not view_classified:
events = events.exclude(classified=True)
- events = events.order_by('-pk')
+ events = events.order_by("-pk")
- return [x for x in events if x.get_current_status().status_type == 'OK'][:5]
+ return list(
+ itertools.islice(
+ (x for x in events if x.get_current_status().status_type == "OK"), 5
+ )
+ )
# Template rendering ----------------------------------------------------------- Affected Components
Affected Modules/Files
Required Architectural Changes Resolution Sketch
diff --git a/HISTORY.rst b/HISTORY.rst
index 0eae5d6..600ea5e 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -35,6 +35,7 @@ End-User Summary
- Added feature to select multiple rows in results to create same annotation (#259)
- Added parameter to Docker entrypoint file to accept number of gunicorn workers
- Extended documentation for how to update specific tables (#177)
+- Improving performance of project overview (#304)
Full Change List
================
@@ -71,6 +72,7 @@ Full Change List
- Added feature to select multiple rows in results to create same annotation (#259)
- Added parameter to Docker entrypoint file to accept number of gunicorn workers
- Extended documentation for how to update specific tables (#177)
+- Improving performance of project overview (#304)
-------
v0.23.9
diff --git a/requirements/base.txt b/requirements/base.txt
index 25298ef..20036ab 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -67,7 +67,8 @@ celery >=5.1.0, <5.2
# TODO: bump to django-postgres-copy==2.6.0?
django-postgres-copy ==2.3.5
-django-sodar-core >=0.10.2, <0.11
+#django-sodar-core >=0.10.2, <0.11
+-e git+https://github.com/bihealth/sodar-core.git@optimize-get_details_events#egg=django-sodar-core
# Simplejson is more advanced than then built-in one.
simplejson >=3.17.2 |
holtgrewe
added a commit
that referenced
this issue
Jan 29, 2022
holtgrewe
added a commit
that referenced
this issue
Jan 29, 2022
We still need to wait for fix in sodar-core. |
This was referenced Jan 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Opening the project overview for projects with many cases is slow.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Result should be almost instantaneous.
Screenshots
N/A
Additional context
The text was updated successfully, but these errors were encountered: