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.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

fastbench-0.1.5-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastbench-0.1.5.tar.gz
  • Upload date:
  • Size: 3.1 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.5.tar.gz
Algorithm Hash digest
SHA256 010ea07a212622a085c5c6750817b5203f96b9d67d99494c27c4d2cab6898e80
MD5 22494a70dbd7e80ba94d22f4662cdccd
BLAKE2b-256 cb9447c99410c99756729dd4319581153638c9c1de6b78835178a0f9a6e5ceb2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastbench-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 67938716a63c62fe12ab4c4d707103ebcba67682ce5a2abac554cd1eed4e1867
MD5 9652ee9a87e2379332fd95828408b532
BLAKE2b-256 630a7a94a0ee9d968235fc57f494cb20539978c2af7f05f259f9946dfbb38335

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