2020from bench_runner import git
2121from bench_runner .result import has_result
2222from bench_runner import util
23- from bench_runner .util import PathLike
23+ from bench_runner .util import log_group , PathLike
2424
2525
2626from bench_runner .scripts import run_benchmarks as mrun_benchmarks
@@ -266,26 +266,33 @@ def _main(
266266 if pystats and platform != "linux" :
267267 raise RuntimeError ("Pystats is only supported on Linux" )
268268
269- checkout_cpython (fork , ref , cpython )
269+ with log_group ("Checking out CPython" ):
270+ checkout_cpython (fork , ref , cpython )
270271
271- if not should_run (force , fork , ref , machine , False , flags , cpython = cpython ):
272- print ("No need to run benchmarks. Skipping..." )
273- return
272+ with log_group ("Determining if we need to run benchmarks" ):
273+ if not should_run (force , fork , ref , machine , False , flags , cpython = cpython ):
274+ print ("No need to run benchmarks. Skipping..." )
275+ return
274276
275- checkout_benchmarks ()
277+ with log_group ("Checking out benchmarks" ):
278+ checkout_benchmarks ()
276279
277- match platform :
278- case "linux" | "macos" :
279- compile_unix (cpython , flags , pgo , pystats )
280- case "windows" :
281- compile_windows (cpython , flags , pgo , force_32bit )
280+ with log_group ("Compiling CPython" ):
281+ match platform :
282+ case "linux" | "macos" :
283+ compile_unix (cpython , flags , pgo , pystats )
284+ case "windows" :
285+ compile_windows (cpython , flags , pgo , force_32bit )
282286
283- # Print out the version of Python we built just so we can confirm it's the
284- # right thing in the logs
285- subprocess .check_call ([get_exe_path (cpython , flags , force_32bit ), "-VV" ])
287+ # Print out the version of Python we built just so we can confirm it's the
288+ # right thing in the logs
289+ subprocess .check_call ([get_exe_path (cpython , flags , force_32bit ), "-VV" ])
286290
287- install_pyperformance (venv )
288- tune_system (venv , perf )
291+ with log_group ("Installing pyperformance" ):
292+ install_pyperformance (venv )
293+
294+ with log_group ("Tuning system" ):
295+ tune_system (venv , perf )
289296
290297 try :
291298 if Path (".debug" ).exists ():
@@ -303,17 +310,18 @@ def _main(
303310 else :
304311 mode = "benchmark"
305312
306- mrun_benchmarks ._main (
307- mode ,
308- get_exe_path (cpython , flags , force_32bit ),
309- fork ,
310- ref ,
311- benchmarks ,
312- flags = flags ,
313- run_id = run_id ,
314- test_mode = False ,
315- individual = pystats ,
316- )
313+ with log_group ("Running benchmarks" ):
314+ mrun_benchmarks ._main (
315+ mode ,
316+ get_exe_path (cpython , flags , force_32bit ),
317+ fork ,
318+ ref ,
319+ benchmarks ,
320+ flags = flags ,
321+ run_id = run_id ,
322+ test_mode = False ,
323+ individual = pystats ,
324+ )
317325 finally :
318326 reset_system (venv )
319327
0 commit comments