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

Matching - Remove unnecessary enumerations #1276

Open
Tracked by #1278
zabeen opened this issue Apr 16, 2024 · 0 comments
Open
Tracked by #1278

Matching - Remove unnecessary enumerations #1276

zabeen opened this issue Apr 16, 2024 · 0 comments
Labels
matching-algorithm Work relates to the algorithm which matches and scores donors for given patient HLA performance-search Covers changes to improve performance specifically *of search requests*.
Milestone

Comments

@zabeen
Copy link
Contributor

zabeen commented Apr 16, 2024

Example 1

var reifiedScoredMatches = scoredMatches.DistinctBy(m => m.MatchResult.DonorId).ToList();

  • .ToList() will load all matches into memory, might be hundreds of 1000s of donors.
  • Also, why is DistinctBy() being applied to scored results set?
    • must be something to do with sub-search logic, as it was added at same time

Example 2

var donorIds = donorBatch.Keys.ToHashSet();
-- I'd propose eliminate this, Dictionary.ContainsKey works as fast as HashSet.Contains do. But taking into consideration batch size, it worth save 5Mb RAM and some CPU time spent on copying data just for fitting to type HashSet<T>

@zabeen zabeen added matching-algorithm Work relates to the algorithm which matches and scores donors for given patient HLA performance-search Covers changes to improve performance specifically *of search requests*. labels Apr 16, 2024
@zabeen zabeen added this to the 2.2.0 milestone Apr 16, 2024
@github-project-automation github-project-automation bot moved this to Project Backlog in Atlas Development Apr 16, 2024
@zabeen zabeen mentioned this issue Apr 16, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
matching-algorithm Work relates to the algorithm which matches and scores donors for given patient HLA performance-search Covers changes to improve performance specifically *of search requests*.
Projects
None yet
Development

No branches or pull requests

1 participant