Is an simple bench tool.
Project description
benchtools
A small project written in C, with a modular port to python. Performs benchmarks using functions.
Use example:
from benchtools import addToBench, benchRound, clearRound
from typing import Any
create functions to bench all functions using this template
def myfuncName() -> None:
"Your code here"
no args, no return. if your execution recive args. encapsule it an parse the args properly.
def myfuncNameWithArgs(arg1, arg2, arg3) -> Any:
"Your code here"
example to encapsule
myfuncNameWithArgsCorrect = lambda : myfuncNameWithArgs('arg1', 'arg2', 'arg3')
after it, you set the functions to bench table, make it calling addToBench
addToBench(myfuncName, "beatifull alias", 4)
the first argument is your callable the second is an alias for view the third is an number of executions to get an average time, if 0 the function not is executed!
addToBench(myfuncNameWithArgsCorrect, "second beatifull alias", 1)
addToBench(myfuncNameWithArgsCorrect, "another beatifull alias", 0) # this not execute!
after it, you like to benchmark, make it calling benchRound
benchRound()
if you like to save the results, set True
benchRound(True)
the file is benchmark.log.csv (comma separated, indexed)
in the end, to reset the benchmark system call clearRound
clearRound()
after it, is free to set new bench function
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file BenchTools-2.0.4.tar.gz.
File metadata
- Download URL: BenchTools-2.0.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb72acf09769e3ae47108cc10064506264d626ada989a0bbfcfbd99bab470980
|
|
| MD5 |
e301abd63e2b9dc70ba2226658def19b
|
|
| BLAKE2b-256 |
3eaee9a9496ab88a6d8517e2cb80c8ce7d78db8e76176b1eb2be75cc36710fed
|
File details
Details for the file BenchTools-2.0.4-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: BenchTools-2.0.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 9.4 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77b014801eb048df42654c1a619bb5ec5d1cc3ca13c3b88e21b578febed599ae
|
|
| MD5 |
ddd27da60cd41da99aa087ed18b3496f
|
|
| BLAKE2b-256 |
ce62d1d6f867bacb057559343675f3a2844adf058024e9a7f5f04263742d2a60
|