Skip to main content

A high-performance benchmarking library for Python

Project description

PyPerfCheck – Easy Benchmarking for Python Code

PyPerfCheck is a high-performance benchmarking library for Python. It allows you to measure and compare the execution time, CPU usage, and memory usage of Python functions. It supports synchronous, asynchronous, multi-threaded, and multi-processed functions, making it a versatile tool for performance analysis.


Features

  • Benchmark Synchronous Functions: Measure execution time, CPU usage, and memory usage.
  • Benchmark Asynchronous Functions: Supports async functions for I/O-bound tasks.
  • Multi-Threading Benchmarking: Test functions using multiple threads.
  • Multi-Processing Benchmarking: Test functions using multiple processes.
  • Visual Reports: Generate bar charts for execution time, CPU usage, and memory usage.
  • Easy-to-Use: Simple API with decorators and helper methods.

Installation

Install PyPerfCheck using pip:

pip install pyperfcheck

Quick Start

  1. Import the library:

    from pyperfcheck import PyPerfCheck
    
  2. Benchmark a function:
    Use the benchmark decorator to measure execution time, CPU, and memory usage for any function.

    @PyPerfCheck.benchmark
    def example_function():
        # Your code here
        time.sleep(1)
    
  3. Compare multiple functions:
    You can benchmark and compare the performance of multiple functions using compare.

    def function1():
        time.sleep(1)
    
    def function2():
        time.sleep(2)
    
    PyPerfCheck.compare([function1, function2])
    
  4. Generate Visual Reports:
    PyPerfCheck can also generate bar charts to visualize the benchmark results.

    # After calling PyPerfCheck.compare(), the visual report will be shown
    

License

MIT License. See LICENSE for details.

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

pyperfcheck-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

pyperfcheck-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pyperfcheck-0.2.0.tar.gz.

File metadata

  • Download URL: pyperfcheck-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.5

File hashes

Hashes for pyperfcheck-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9146ab60a0e2890082ca22f8d5681eff978fe523ab192af2bbda7201ebc5595d
MD5 b1cecba804df7c9dfde0c7ee02aab85e
BLAKE2b-256 eda3cdfc4751f35ebf693ae708829ee7488747cba76264b0389a542981191fb3

See more details on using hashes here.

File details

Details for the file pyperfcheck-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyperfcheck-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.5

File hashes

Hashes for pyperfcheck-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83feb5f074dedc8689a1c06805cb1ba538ec7719e7844bd148c6d20f2a31836e
MD5 d279e4ee9d0b816574227b809686858f
BLAKE2b-256 b3ea3a8b67c24eac2f7a8c0ce6b2647add989bfa916687bd89888f141e407047

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