FastBench
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.
Release files for fastbench 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastbench-0.1.5.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastbench-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / fastbench-0.1.5.tar.gz
| Download URL | fastbench-0.1.5.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
010ea07a212622a085c5c6750817b5203f96b9d67d99494c27c4d2cab6898e80
|
|
BLAKE2b-256 checksum How to use checksums |
cb9447c99410c99756729dd4319581153638c9c1de6b78835178a0f9a6e5ceb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1018-azure
|
Release files / fastbench-0.1.5-py3-none-any.whl
| Download URL | fastbench-0.1.5-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67938716a63c62fe12ab4c4d707103ebcba67682ce5a2abac554cd1eed4e1867
|
|
BLAKE2b-256 checksum How to use checksums |
630a7a94a0ee9d968235fc57f494cb20539978c2af7f05f259f9946dfbb38335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1018-azure
|