Skip to main content

An Easy Way To Benchmark Your Python Code

Project description

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

"""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 And Keep It Inside Your Working Directory.

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)

Pypi

I will soon upload it to pypi
Therefore you will only be required to pip install it

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 - sonicroshan122@gmail.com

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

python_raptor-0.2.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_raptor-0.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file python_raptor-0.2.tar.gz.

File metadata

  • Download URL: python_raptor-0.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for python_raptor-0.2.tar.gz
Algorithm Hash digest
SHA256 ffb41fb44e0976718543fe84c4bd9466da22740e7082506ead59093218e74c35
MD5 04e0469b1e4e5a5831470766a649523d
BLAKE2b-256 110381552ddd6f3dea332f63c8f7ad939d75ecb38a0e8259f3bce432ad76ef11

See more details on using hashes here.

File details

Details for the file python_raptor-0.2-py3-none-any.whl.

File metadata

  • Download URL: python_raptor-0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for python_raptor-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04232131f7b98ed0f7526cb23bbd9a32c84145b34b7879b6a6a3d12ccaaf6f5a
MD5 04640820ff0468c6805cedeff6aa6c1a
BLAKE2b-256 fa7b8cde22af60fb1e4e8c65a0894e6c4b27936fa621286c4961e69dd91ed1a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page