Skip to main content

A pure-python based benchmarking package for Python 🤪

Project description



FastBench
PyPI - Downloads GitHub repo size

FastBench is a high-performance Python package for benchmarking code execution time, CPU usage, and memory usage. It's implemented in Python for simplicity and provides a simple API for measuring the performance of your Python code.

✨ Features

  • ️ Measure the execution time of a function or code block
  • ️ Track CPU usage during code execution
  • Monitor memory usage during code execution
  • ⚡ Lightweight and fast
  • Simple and easy-to-use API

Installation

You can install FastBench via pip:

pip install fastbench

Usage

Here's an example of how to use FastBench to benchmark Python code:

from fastbench import mt, mc, mm

# Define a sample function for testing
def sample_function(n):
  return sum(range(n))

# Test the mt function (measure execution time)
time_taken = mt(sample_function, n=1000000)
print("Time taken:", time_taken)

# Test the mc function (measure CPU usage)
cpu_usage = mc(sample_function, n=1000000)
print("CPU usage:", cpu_usage)

# Test the mm function (measure memory usage)
memory_usage = mm(sample_function, n=1000000)
print("Memory usage:", memory_usage)

Contributing

Contributions are welcome! Check out the Contribution Guidelines.

License

This project is licensed under the MIT License - see the LICENSE file 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

fastbench-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

fastbench-0.1.3-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file fastbench-0.1.3.tar.gz.

File metadata

  • Download URL: fastbench-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1018-azure

File hashes

Hashes for fastbench-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0e9dd5f31f9c478bdba5d6f651d9404e498ab22421f011580cbf4fa9f83d1008
MD5 958de28db62fc913d80134cda805fe5c
BLAKE2b-256 8c90c85a1ae5d0dcd55c990f623e5cff26e5682a7d3524d4c9d72c0c5654746f

See more details on using hashes here.

File details

Details for the file fastbench-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fastbench-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1018-azure

File hashes

Hashes for fastbench-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0a9691dc6244ca0912fb943832157f4c1f71b3db785c050a035e5962679695
MD5 764415120986e04aae992e8c975dfc54
BLAKE2b-256 2b297da362210d7536038fb991ac0f8ea8980dc45ddcdf9194ecc37a43d89917

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