Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.cwd": "${workspaceFolder}",
"explorer.autoRevealExclude": {
".mypy_cache": true,
".venv": true,
Expand Down Expand Up @@ -51,7 +52,6 @@
"python.createEnvironment.contentButton": "show",
"python.envFile": "${workspaceFolder}/.env",
"python.terminal.launchArgs": [],
"python.testing.cwd": "${workspaceFolder}",
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"pylint.cwd": "${workspaceFolder}/src",
"codeQL.createQuery.qlPackLocation": "{$workspaceFolder}",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ SimpleBench

A framework for building and running benchmarks.

* 0.5.0-alpha-0 2025-11-30
* Extended CSVReporter and RichTableReporter to allow customization
of output columns using options.
* Added checked support for explict parameters in benchmark functions.
* Completed documentation for parameterized benchmarks.

* 0.4.1-alpha.0 2025-11-29 - Seventh alpha release
* **Documentation Update**
* Migration of README to .rst format
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SimpleBench
===========

**SimpleBench** is a Python framework for benchmarking and performance testing of code.
**SimpleBench** is a modern Python framework for benchmarking and performance testing of code.

As such it has the following goals:

Expand Down Expand Up @@ -48,7 +48,8 @@ Documentation
* `Installation <https://python-simplebench.readthedocs.io/en/latest/installation.html>`_
* `Using SimpleBench <https://python-simplebench.readthedocs.io/en/latest/usage.html>`_
* `Tutorials <https://python-simplebench.readthedocs.io/en/latest/tutorials.html>`_
* `Basic Usage Tutorial <https://python-simplebench.readthedocs.io/en/latest/tutorials/basic.html>`_
* `Basic Benchmark <https://python-simplebench.readthedocs.io/en/latest/tutorials/basic.html>`_
* `Parameterized Benchmark <https://python-simplebench.readthedocs.io/en/latest/tutorials/parameterized.html>`_
* `Command-Line Options <https://python-simplebench.readthedocs.io/en/latest/command_line_options.html>`_
* `Reports <https://python-simplebench.readthedocs.io/en/latest/reports.html>`_
* `Rich Table Report <https://python-simplebench.readthedocs.io/en/latest/reports/rich_table_report.html>`_
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""A basic parameterized benchmark."""
import simplebench


@simplebench.benchmark(kwargs_variations={'size': [1, 5, 10, 50, 100, 500, 1000]},
variation_cols={'size': 'Input Size'},
use_field_for_n='size')
def addition_benchmark(size: int) -> None:
"""A simple addition benchmark of Python's built-in sum function."""
sum(range(size))


if __name__ == "__main__":
simplebench.main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""A multidimensional parameterized benchmark."""
import simplebench


@simplebench.benchmark(
kwargs_variations={
'size': [10, 100, 1000],
'mode': ['fast', 'slow']
},
variation_cols={
'size': 'Input Size',
'mode': 'Mode'
},
use_field_for_n='size')
def my_benchmark(size: int, mode: str) -> None:
"""A benchmark for summing a range of numbers that varies by size and mode."""
match mode:
case 'fast':
sum(range(size))
case 'slow':
total = 0
for i in range(size):
total += i


if __name__ == "__main__":
simplebench.main()
15 changes: 9 additions & 6 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../genindex.html"><link rel="search" title="Search" href="../search.html">

<!-- Generated with Sphinx 8.1.3 and Furo 2025.09.25 -->
<title>Overview: module code - simplebench 0.4.0-alpha.0 documentation</title>
<title>Overview: module code - simplebench 0.4.1-alpha.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=c309799c" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=d998a142" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx-design.min.css?v=95c83b7e" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo-extensions.css?v=06aecd32" />
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=0e890c2c" />
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=c2cf19b8" />



Expand Down Expand Up @@ -163,7 +163,7 @@
</label>
</div>
<div class="header-center">
<a href="../index.html"><div class="brand">simplebench 0.4.0-alpha.0 documentation</div></a>
<a href="../index.html"><div class="brand">simplebench 0.4.1-alpha.0 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -184,7 +184,7 @@

<div class="sidebar-sticky"><a class="sidebar-brand" href="../index.html">

<span class="sidebar-brand-text">simplebench 0.4.0-alpha.0 documentation</span>
<span class="sidebar-brand-text">simplebench 0.4.1-alpha.0 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand All @@ -199,7 +199,8 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../tutorials.html">Tutorials</a><input aria-label="Toggle navigation of Tutorials" class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/basic.html">Basic Usage Tutorial</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/basic.html">Basic Benchmark</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/parameterized.html">Parameterized Benchmark</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../command_line_options.html">Command-Line Options</a></li>
Expand Down Expand Up @@ -266,6 +267,7 @@ <h1>All modules for which code is available</h1>
<li><a href="simplebench/reporters/choices/choices.html">simplebench.reporters.choices.choices</a></li>
<li><a href="simplebench/reporters/choices/choices_conf.html">simplebench.reporters.choices.choices_conf</a></li>
<li><a href="simplebench/reporters/csv/reporter/config.html">simplebench.reporters.csv.reporter.config</a></li>
<li><a href="simplebench/reporters/csv/reporter/options/fields.html">simplebench.reporters.csv.reporter.options.fields</a></li>
<li><a href="simplebench/reporters/csv/reporter/options/options.html">simplebench.reporters.csv.reporter.options.options</a></li>
<li><a href="simplebench/reporters/csv/reporter/reporter.html">simplebench.reporters.csv.reporter.reporter</a></li>
<li><a href="simplebench/reporters/graph/enums/image_type.html">simplebench.reporters.graph.enums.image_type</a></li>
Expand All @@ -292,6 +294,7 @@ <h1>All modules for which code is available</h1>
<li><a href="simplebench/reporters/reporter_manager/decorators/register_reporter/register_reporter.html">simplebench.reporters.reporter_manager.decorators.register_reporter.register_reporter</a></li>
<li><a href="simplebench/reporters/reporter_manager/manager.html">simplebench.reporters.reporter_manager.manager</a></li>
<li><a href="simplebench/reporters/rich_table/reporter/config.html">simplebench.reporters.rich_table.reporter.config</a></li>
<li><a href="simplebench/reporters/rich_table/reporter/options/fields.html">simplebench.reporters.rich_table.reporter.options.fields</a></li>
<li><a href="simplebench/reporters/rich_table/reporter/options/options.html">simplebench.reporters.rich_table.reporter.options.options</a></li>
<li><a href="simplebench/reporters/rich_table/reporter/reporter.html">simplebench.reporters.rich_table.reporter.reporter</a></li>
<li><a href="simplebench/reporters/validators/validators.html">simplebench.reporters.validators.validators</a></li>
Expand Down Expand Up @@ -351,7 +354,7 @@ <h1>All modules for which code is available</h1>

</aside>
</div>
</div><script src="../_static/documentation_options.js?v=a9a3c2eb"></script>
</div><script src="../_static/documentation_options.js?v=d4d890f0"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/furo.js?v=46bd48cc"></script>
Expand Down
Loading