Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsmeadarsh2008/fastbench
A pure-python based benchmarking package for Python π€ͺ
https://github.com/itsmeadarsh2008/fastbench
benchmark dead-simple lightweight pure-python python simple
Last synced: about 1 month ago
JSON representation
A pure-python based benchmarking package for Python π€ͺ
- Host: GitHub
- URL: https://github.com/itsmeadarsh2008/fastbench
- Owner: itsmeadarsh2008
- License: mit
- Created: 2024-04-27T09:30:06.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-28T04:25:30.000Z (8 months ago)
- Last Synced: 2024-10-07T22:11:58.058Z (3 months ago)
- Topics: benchmark, dead-simple, lightweight, pure-python, python, simple
- Language: Python
- Homepage: https://github.com/itsmeadarsh2008/fastbench
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
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:
```bash
pip install fastbench
```## Usage
Here's an example of how to use FastBench to benchmark Python code:
```python
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](https://github.com/itsmeadarsh2008/fastbench/blob/main/CONTRIBUTING.md).
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/itsmeadarsh2008/fastbench?tab=MIT-1-ov-file) file for details.