Benchpress

benchpress.benchpress.command(cmd, label, env={})[source]

Create a Benchpress command, which define a single benchmark execution

This is a help function to create a Benchpress command, which is a Python dict of the parameters given.

Parameters:
  • cmd (str) – The bash string that makes up the command
  • label (str) – The human readable label of the command
  • env (dict) – The Python dictionary of environment variables to define before execution’
Returns:

command – The created Benchpress command

Return type:

dict

benchpress.benchpress.create_suite(cmd_list, output_path=None)[source]

Create a suite file (JSON) based on a list of commands

Parameters:
  • cmd_list (list of dict) – List of commands that makes up this benchmark suite.
  • output_path (str) – Path to the output file when the –output argument is unset. If None, a path to a temporary file is used.

See also

command()
Help function to create a new command

Utilities for Generating Commands

benchpress.suite_util.benchmark_path(name, implementation, extension)[source]

Returns the path to the executable of a benchmark implementation in the include suites.

Parameters:
  • name (str) – The name of the benchmark e.g. ‘montecarlo_pi’
  • implementation (str) – The name of the implementation e.g. ‘python_numpy’
  • extension (str) – The extension of the executable e.g. ‘.py’
Returns:

path – Absolute path to the executable

Return type:

str