Skip to content

calculate_summary_stats takes significant time with lots of untested mutants #413

@Otto-AA

Description

@Otto-AA

I've ran mutmut run once with the normal print_stats method and once with calculate_summary_stats(...) commented out. In my case (with ~2000 of untested mutants) this changed it from ~80s to ~70s total runtime.

I think usually this won't be noticeable, however when running only a subset of the tests (eg with tests_dir), it is normal to have many untested mutants. For this use case, this is a significant slowdown.

The status_printer method already has a check to print only every 0.1s. Maybe we could make it a class that exposes a would_print() -> bool method and then we only calculate the summary stats every 0.1s. Or we could pass it the summary stats creating function as argument, and the status_printer calls the method every 0.1s.

Maybe we could also make calculate_summary_stats more efficient, I didn't look into that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions