Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`calculate_summary_stats` takes significant time with lots of untested mutants

未关闭
#413 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

首先跟踪 status_printer、print_stats 和 calculate_summary_stats,然后使用 mutmut run 和 tests_dir 的一个子集重现报告中的比较结果。完成的标准是:汇总统计相关工作不再导致所报告的变慢,同时状态输出仍然正确;该 issue 没有指定要运行的具体文件或测试。

由索引模型根据 Issue 内容生成。

描述

enhancement

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.

主要语言
Python
星标
1.5k
派生
185
平均合并
1 天 14 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

boxed/mutmut 的其他 Issue

查看 boxed/mutmut 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。