From 81739a7f21af64a7d602895d12cb0448b21a688c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 2 May 2023 15:59:55 +0100 Subject: [PATCH] Improve performance reports - Differences less than 10 seconds seem to happen quite regularly just due to random variations in GitHub Actions, so don't report performance changes if the difference is less than 10 seconds. - Clarify that it's mypy that got faster/slower, not the package we're running mypy on :-) --- mypy_primer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy_primer.py b/mypy_primer.py index c6bdb15..2b5a60c 100644 --- a/mypy_primer.py +++ b/mypy_primer.py @@ -558,14 +558,14 @@ def format_concise(self) -> str: else: speed = "slower" - has_runtime_diff = runtime_diff > 5 and runtime_ratio > 1.05 + has_runtime_diff = runtime_diff > 10 and runtime_ratio > 1.05 if not self.diff and not has_runtime_diff: return "" ret = f"{self.project.name} ({self.project.location})" if has_runtime_diff: ret += ( - f" got {runtime_ratio:.2f}x {speed} " + f": type-checking got {runtime_ratio:.2f}x {speed} " f"({self.old_result.runtime:.1f}s -> {self.new_result.runtime:.1f}s)" ) if self.diff: