Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thundr67/raptor
An Easy Way To Benchmark Your Python Code
https://github.com/thundr67/raptor
benchmark benchmark-framework benchmarking benchmarks pytho python python3 tool
Last synced: about 2 months ago
JSON representation
An Easy Way To Benchmark Your Python Code
- Host: GitHub
- URL: https://github.com/thundr67/raptor
- Owner: ThundR67
- License: gpl-3.0
- Created: 2019-02-09T08:39:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-10T07:24:13.000Z (almost 6 years ago)
- Last Synced: 2024-04-24T01:43:11.397Z (9 months ago)
- Topics: benchmark, benchmark-framework, benchmarking, benchmarks, pytho, python, python3, tool
- Language: Python
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Raptor
A Easy Way To Benchmark Your Code.
# How To Use It
Step 1: First You Will Need To Create A Benchmark File For Your Project```python3
"""to_benchmark.py"""#Add All Your Setup
import math#Write Your Benchmarking Functions
def bench_square_root():
"""Name Your Function Starting With bench. Or Raptor Wont Detect It
Also the function should not take any arguments"""
return math.sqrt(25)
def bench_multiply():
return 5 ** 25
```Step 2: Download raptor.py
```
pip install python-raptor
```Then, Run This In Your Terminal
**NOTICE: The -t Argument Takes An Integer Which Tells Raptor How Many Times
Should Each Benchmarking Function Run**
```
raptor.py to_benchmark.py -t 10000
```Step 3: See The Output. Voilaaaaa!!!!!!!!!
Output
```
========== Bench Marking ===========
[bench_square_root] Took 0.0025385 Seconds For 10000 Run(s)
[bench_multiply] Took 0.0010813999999999997 Seconds For 10000 Run(s)
```# Future Features
1. I want to add an history, which can show you how much faster or slower your program has gotten
2. I want to add colored output
3. I want to add better exception handling# Built With
Raptor Uses Timeit Module To Benchmark Your Code# Author
Roshan Jignesh Mehta - [email protected]