Skip to main content

Is an simple bench tool.

Project description

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 set_bench, bench_round, clear_round
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 set_bench

set_bench(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!

set_bench(myfuncNameWithArgsCorrect, "second beatifull alias", 1)
set_bench(myfuncNameWithArgsCorrect, "another beatifull alias", 0) # this not execute!

after it, you like to benchmark, make it calling bench_round

bench_round()

if you like to save the results, set True

bench_round(True)

the file is benchmark.log.csv (comma separated, indexed)

in the end, to reset the benchmark system call clear_round

clear_round()

after it, is free to set new bench function

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BenchTools-1.0.3.post2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BenchTools-1.0.3.post2-cp310-cp310-win_amd64.whl (9.3 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file BenchTools-1.0.3.post2.tar.gz.

File metadata

  • Download URL: BenchTools-1.0.3.post2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for BenchTools-1.0.3.post2.tar.gz
Algorithm Hash digest
SHA256 fcf762476b00332a6f89c1abf5d83f02cff8fc858c6bbd8014826b04414c9400
MD5 dec5ffdce8c36777e955917dca31ee22
BLAKE2b-256 f7b35e0597eaa48fc910e49a9a7a443ddd0fdfd8f68d91abe354869f5daff275

See more details on using hashes here.

File details

Details for the file BenchTools-1.0.3.post2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for BenchTools-1.0.3.post2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7524914f71c7f3f8a44bb4a4afb8e52de14929bb9c6d251bef2e892be84a71b7
MD5 2aacc49d3bdce918e46f5901c807984a
BLAKE2b-256 e475e3e6c2eec6891c09ca166079d7b8014c30175c93c479bf93e9a5e85ef6db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page