DASL-Lab / provoc

PROportions of Variants of Concern using counts, coverage, and a variant matrix.
https://dasl-lab.github.io/provoc/
MIT License
0 stars 0 forks source link

Faster `parse_unique_mutations` function #4

Closed DBecker7 closed 6 months ago

DBecker7 commented 7 months ago

It's slow. Make it not slow.

Link to relevant function. It may be worthwhile to modify the way parse_mutation works. Note that parse_mutations is the only function that's exported, so modifying the other functions shouldn't break any existing code.

danerkestey commented 6 months ago

I will begin by profiling the parse_mutations function to identify any performance bottlenecks. Possible optimizations might include reusing computed results to avoid repeated calculations, or rethinking data structure usage for faster access. Since parse_mutations is the only exported function, I'll ensure any internal changes do not affect the public API. After optimization, I'll test for both improved speed and maintained functionality.

There are nested loops in parse_unique_mutations and string operations within loops which could lead to worse performance.