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

Improve study-view treatment api's performance #10261

Merged
merged 4 commits into from
Jul 13, 2023

Conversation

kalletlak
Copy link
Member

@kalletlak kalletlak commented Jul 10, 2023

Improve performance for

  1. /treatments/display-patient
  2. /treatments/display-sample
  3. /treatments/sample
  4. /treatments/patient

Improves performance by 10x

@kalletlak kalletlak changed the title Improve treatment display api performance Improve study-view treatment api's performance Jul 12, 2023
@inodb inodb requested a review from haynescd July 12, 2023 14:41
@@ -25,7 +25,7 @@ private Pair<List<String>, List<String>> filterIds(List<String> sampleIds, List<
}
Set<String> studiesWithTreatments = studyIds.stream()
.distinct()
.filter(studyId -> treatmentRepository.studyIdHasTreatments(studyId, key))
.filter(studyId -> treatmentRepository.hasTreatmentData(Collections.singletonList(studyId), key))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be appropriate for this PR but do you think this could be done as a SQL query?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could. Also we might not need this once after moving to new database. I would prefer to leave it as is for now and revisit after moving to new database.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write a ticket for this. Even with a new database we may still need to address this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@kalletlak
Copy link
Member Author

Copy link
Contributor

@JREastonMarks JREastonMarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@kalletlak kalletlak merged commit b3400e6 into cBioPortal:master Jul 13, 2023
9 checks passed
@kalletlak kalletlak deleted the timeline-performance branch July 13, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants