Skip to main content

benchtools

A small project written in C, with a modular port to python. Performs benchmarks using functions.

GitHub-BenchTools

GitHub-Issues

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

Release files for BenchTools 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BenchTools 2.0.4
File Size Uploaded
BenchTools-2.0.4.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BenchTools 2.0.4
File Interpreter ABI Platform
BenchTools-2.0.4-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details

Total release size: 14.7 kB

Release files / BenchTools-2.0.4.tar.gz

Download URL BenchTools-2.0.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bb72acf09769e3ae47108cc10064506264d626ada989a0bbfcfbd99bab470980
BLAKE2b-256 checksum
How to use checksums
3eaee9a9496ab88a6d8517e2cb80c8ce7d78db8e76176b1eb2be75cc36710fed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Release files / BenchTools-2.0.4-cp310-cp310-win_amd64.whl

Download URL BenchTools-2.0.4-cp310-cp310-win_amd64.whl
Size 9.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
77b014801eb048df42654c1a619bb5ec5d1cc3ca13c3b88e21b578febed599ae
BLAKE2b-256 checksum
How to use checksums
ce62d1d6f867bacb057559343675f3a2844adf058024e9a7f5f04263742d2a60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Release history Release notifications | RSS feed

This release

2.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page