-
Notifications
You must be signed in to change notification settings - Fork 29
jpa loading of starred entries #6130
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
Conversation
This reverts commit 36f1fba.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6130 +/- ##
==========================================
Coverage 74.19% 74.20%
- Complexity 5662 5664 +2
==========================================
Files 389 389
Lines 20341 20344 +3
Branches 2102 2102
==========================================
+ Hits 15092 15096 +4
+ Misses 4250 4249 -1
Partials 999 999
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dockstore-webservice/src/main/java/io/dockstore/webservice/resources/UserResource.java
Outdated
Show resolved
Hide resolved
|
Description
Basic problem is that tool workflow versions are eagerly loaded whereas workflow workflow versions are properly lazily loaded.
See
https://github.com/dockstore/dockstore/blob/1.17.1/dockstore-webservice/src/main/java/io/dockstore/webservice/core/Tool.java#L168
vs
https://github.com/dockstore/dockstore/blob/1.17.1/dockstore-webservice/src/main/java/io/dockstore/webservice/core/Workflow.java#L159
However, https://github.com/dockstore/dockstore/blob/1.17.1/dockstore-webservice/src/main/java/io/dockstore/webservice/core/User.java#L159 essentially cycles through both tools and workflows, which is why the starred tools, starred workflows, and starred notebooks all have roughly the same runtime, more noticeable in aws, despite returning much different results.
An initial idea was to lazy load the tools first, but it breaks too much to just optimize for a bit of an edge case. The smaller optimization is to load only tools for starred tools, only workflows for starred workflows, etc. via JPA.
This could be combined with making tool versions actually lazy later (i.e. not an either/or)
Review Instructions
Load up a recent DB, timings between JPA queries and original should be similar to the following
original


with queries
Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-7204
Security and Privacy
None
e.g. Does this change...
Please make sure that you've checked the following before submitting your pull request. Thanks!
mvn clean install@RolesAllowedannotation