Skip to main content

A framework for benchmarking in python

Project description

benchwork

A framework for benchmarking in python

Installation

pip install -U benchwork

Usage

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 = 10

    def run_core(self):
        import time
        time.sleep(.1)


class BenchSetSpeed(BenchSetSpeed):
    case = BenchCaseSpeed


class BenchSuite(BenchSuite):
    """Benchmarking suite"""
    set_classes = [BenchSetVersion, BenchSetSpeed]


if __name__ == "__main__":
    run_suite(BenchSuite, None, "Benchmarking")

Output:

# Benchmarking

Benchmarking 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|

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

benchwork-0.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

benchwork-0.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file benchwork-0.0.2.tar.gz.

File metadata

  • Download URL: benchwork-0.0.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.15.0-1022-azure

File hashes

Hashes for benchwork-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5e6c3ba005c535485534bb67fe48b16a153739103c2d4e319eca57730701fdbe
MD5 d20ee5acbcaacfaed5f6efc553d72db2
BLAKE2b-256 dadd462a98af7aa97e69d922a38459be009d3ce122b6ebd010e842245a7886ca

See more details on using hashes here.

File details

Details for the file benchwork-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: benchwork-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.15.0-1022-azure

File hashes

Hashes for benchwork-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 108ca9bd7aef958ff0b5af1e41d654d95296629ffcffb2b49a9ba1a9347f1fb2
MD5 9989441236b493611b350905479f8afd
BLAKE2b-256 fa182aa185ae0f1be1af719a98836a6f5082fbcd92b27b152615b37b057dc33b

See more details on using hashes here.

Supported by

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