Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pwwang/benchwork
A framework for benchmarking in python
https://github.com/pwwang/benchwork
benchmark-framework benchmarking benchmarking-framework benchmarking-suite python testing
Last synced: 14 days ago
JSON representation
A framework for benchmarking in python
- Host: GitHub
- URL: https://github.com/pwwang/benchwork
- Owner: pwwang
- Created: 2022-09-21T06:11:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-12T00:46:11.000Z (about 2 years ago)
- Last Synced: 2024-12-10T04:27:13.809Z (24 days ago)
- Topics: benchmark-framework, benchmarking, benchmarking-framework, benchmarking-suite, python, testing
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# benchwork
A framework for benchmarking in python
## Installation
```python
pip install -U benchwork
```## Usage
```python
from benchwork import (
BenchAPI,
BenchCaseSpeed,
BenchSuite,
BenchSetSpeed,
BenchSetVersion,
run_suite,
)class BenchAPIPackage1(BenchAPI):
name = "package1"
version = "0.0.1"class BenchAPIPackage2(BenchAPI):
name = "package2"
version = "0.0.2"class BenchCaseSpeed(BenchCaseSpeed):
timeit_number = 10def run_core(self):
import time
time.sleep(.1)class BenchSetSpeed(BenchSetSpeed):
case = BenchCaseSpeedclass BenchSuite(BenchSuite):
"""Benchmarking suite"""
set_classes = [BenchSetVersion, BenchSetSpeed]if __name__ == "__main__":
run_suite(BenchSuite, None, "Benchmarking")
```Output:
```markdown
# BenchmarkingBenchmarking suite
## Versions
Show versions of testing packages
| |Version|
|-|-----------------------|
|package1|0.0.1|
|package2|0.0.2|## Running speed
| |Speed|
|-|-----------------------|
|package1|1.003228693996789|
|package2|1.0028911930057802|
```