From ed7503dbbe2990735c4aca92ab1896480417f72f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 25 Sep 2024 12:20:45 -0700 Subject: [PATCH] feat: optimize find_latest_benchmark_dir to check only .md files and limit to one file per subtree --- benchmark/benchmark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 1f6894ba9..43c6595ef 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -49,7 +49,7 @@ def find_latest_benchmark_dir(): latest_dir = max( benchmark_dirs, - key=lambda d: max(f.stat().st_mtime for f in d.rglob("*") if f.is_file()), + key=lambda d: next((f.stat().st_mtime for f in d.rglob("*.md") if f.is_file()), 0), ) print(f"Using the most recently updated benchmark directory: {latest_dir.name}") return latest_dir