diff --git a/pyperf/_manager.py b/pyperf/_manager.py index a55f7a5a..d6a8e7e2 100644 --- a/pyperf/_manager.py +++ b/pyperf/_manager.py @@ -234,12 +234,23 @@ def choose_next_run(self): # else: keep action 'values' def create_bench(self): - old_warmups = self.args.warmups - old_loops = self.args.loops - if self.args.warmups is None: - self.args.warmups = 1 + args = self.args + old_loops = args.loops + old_warmups = args.warmups + old_values = args.values + old_processes = args.processes + if args.warmups is None: + args.warmups = 1 while self.nprocess < self.need_nprocess: + if (args.in_process + and not self.calibrate_loops + and not self.calibrate_warmups): + # --in-process computes all values in a single process + args.values *= args.processes + args.processes = 1 + self.need_nprocess = 1 + worker_bench, run = self.create_worker_bench() self.display_run(worker_bench, run) self.handle_calibration(run) @@ -247,6 +258,8 @@ def create_bench(self): # restore the old value of warmups and loops, to recalibrate # the next benchmark function if needed - self.args.warmups = old_warmups - self.args.loops = old_loops + args.loops = old_loops + args.warmups = old_warmups + args.values = old_values + args.processes = old_processes return self.bench diff --git a/pyperf/_runner.py b/pyperf/_runner.py index 74738665..e159c024 100644 --- a/pyperf/_runner.py +++ b/pyperf/_runner.py @@ -297,7 +297,6 @@ def _process_args_impl(self): nvalues = self.argparser.get_default('values') if args.rigorous: args.processes = nprocess * 2 - # args.values = nvalues * 5 // 3 elif args.fast: # use at least 3 processes to benchmark 3 different (randomized) # hash functions