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.post3.tar.gz (5.3 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.post3-cp310-cp310-win_amd64.whl (9.4 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

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

File metadata

  • Download URL: BenchTools-1.0.3.post3.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

Hashes for BenchTools-1.0.3.post3.tar.gz
Algorithm Hash digest
SHA256 ce5c7d8650bc8ce8e148b507fbe9352748650b15adcff3ec0f7ece7b986b2b48
MD5 31a014d7d75367d008c4cc253c9538b6
BLAKE2b-256 66822fd39a6442dba1cb20ef3e0cdad8314cf80c184429e42ff5d7e3b675165d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BenchTools-1.0.3.post3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1c0931cd53e30a02ce14e2d0c854a0b14915efdca128b0630e14089b05c901bc
MD5 c30fee6a8baaf8ac3babb05f8301ed4b
BLAKE2b-256 8dc4221fa63775e6a4e3f1dd48b3a42a3f1f90acf285f920714b1ac3960d1283

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