Skip to content

Make fast version of SymptomManager #1601

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

Open
1 task
tbhallett opened this issue Feb 28, 2025 · 1 comment
Open
1 task

Make fast version of SymptomManager #1601

tbhallett opened this issue Feb 28, 2025 · 1 comment

Comments

@tbhallett
Copy link
Collaborator

tbhallett commented Feb 28, 2025

In profiling, a lot of time is taken in SymptomManager. This is because it is designed to do a lot of checking (that the symptom exists, and the disease is allowed to apply it, and when its resolved its only resolved by the disease that caused it).

Whilst these checks are useful in development, now that we never have problems, we can dispense with these checks.

We should we create a drop-in replacement for SymptomManager called SymptomManagerLite that has the same functionality and interface, but internally does the simplest and quickest thing possible. This could be making all the symptoms columns bools

Tasks:

  • Optimize the has_what() function. Explore usage of bools and/or separate dict and test performance
@tamuri tamuri changed the title Make Fast Version of Symptom Manager Make fast version of SymptomManager Feb 28, 2025
@thewati thewati self-assigned this May 2, 2025
@thewati
Copy link
Collaborator

thewati commented Jun 3, 2025

Upon further reflection, it would be better to simply add a column to do bookkeeping of symptoms that have been set and/or unset for each person in the same SymtomManager module. This could use a pandas column (i.e., with bitset) or a separate dictionary

Tasks:

  • Try dictionary option
  • Try bitset option
  • Do profiling of both and keep the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants