@@ -412,8 +412,7 @@ def format_checks(bench, lines=None, check_too_many_processes=False):
412
412
mean = bench .mean ()
413
413
warnings = []
414
414
warn = warnings .append
415
-
416
- required_nprocesses = bench .required_nprocesses ()
415
+ required_nprocesses = None
417
416
418
417
# Display a warning if the standard deviation is greater than 10%
419
418
# of the mean
@@ -425,6 +424,7 @@ def format_checks(bench, lines=None, check_too_many_processes=False):
425
424
% (bench .format_value (stdev ), percent , bench .format_value (mean )))
426
425
else :
427
426
# display a warning if the number of samples isn't enough to get a stable result
427
+ required_nprocesses = bench .required_nprocesses ()
428
428
if (
429
429
required_nprocesses is not None and
430
430
required_nprocesses > len (bench ._runs )
@@ -466,16 +466,18 @@ def format_checks(bench, lines=None, check_too_many_processes=False):
466
466
lines .append ("Use pyperf stats, pyperf dump and pyperf hist to analyze results." )
467
467
lines .append ("Use --quiet option to hide these warnings." )
468
468
469
- if (
470
- check_too_many_processes and
471
- required_nprocesses is not None and
472
- required_nprocesses < len (bench ._runs ) * 0.75
473
- ):
474
- lines .append ("Benchmark was run more times than necessary to get a stable result." )
475
- lines .append (
476
- "Consider passing processes=%d to the Runner constructor to save time." %
477
- required_nprocesses
478
- )
469
+ if check_too_many_processes :
470
+ if required_nprocesses is None :
471
+ required_nprocesses = bench .required_nprocesses ()
472
+ if (
473
+ required_nprocesses is not None and
474
+ required_nprocesses < len (bench ._runs ) * 0.75
475
+ ):
476
+ lines .append ("Benchmark was run more times than necessary to get a stable result." )
477
+ lines .append (
478
+ "Consider passing processes=%d to the Runner constructor to save time." %
479
+ required_nprocesses
480
+ )
479
481
480
482
# Warn if nohz_full+intel_pstate combo if found in cpu_config metadata
481
483
for run in bench ._runs :
0 commit comments