The pybench
command-line tool can run a number of compute-intensive performance benchmarks and gather telemetry on not just the time to execute but also CPU and memory footprint. The logging output generated by a run can be piped into an included graphing utility to look at resource consumption during task execution.
The focus is on numerical and scientific computing tasks, but common pure-Python tasks are also included. Discover tasks with pybench list
.
Run tasks by name and provide arguments. For example, to execute a large matrix multiplication task 30 times for float64
precision for a given size:
pybench run numpy.matmul float64 20000 --repeat 30 --spacing 10 --monitor-cpu --monitor-memory \
|& tee output.log | pybench graph -o results.pdf --print