Skip to main content

paragon

A tiny command line benchmarking utility (and a python library!)

Demo

asciicast

Features

  • Statistical analysis
  • Cool progress bars
  • Python library
  • Export results to various file formats (todo)

Installation

You can install the command line utility via pip:

$ pip install paragon

Usage

You can use paragon as a command line utility or a python library.

CLI

After running --help:

Options:
  -a, --accuracy INTEGER  Number of iterations
  -f, --files PATH        Input file path(s)
  -o, --output PATH       Output file path
  --help                  Show this message and exit.

Examples:

Benchmarking code as a string:

$ paragon "print('hello, world')" -a 20

Providing a python file:

$ paragon -f /path/to/file.py

Library

Example:

from paragon import Paragon

n = 1000000

def main():
    """entry point"""
    fizzbuzz(n)
    fib_wrapper(30)

@Paragon.benchmark(name="FizzBuzz!", accuracy=20)
def fizzbuzz(n):
    return list(
        map(
            lambda i: "Fizz" * (i % 3 == 0) + "Buzz" * (i % 5 == 0) or str(i),
            range(1, n),
        )
    )

# You must wrap your recursive functions
@Paragon.benchmark(name="Fibonacci!", accuracy=20)
def fib_wrapper(n):
    def fib(n):
        return 1 if n in [0, 1] else fib(n - 1) + fib(n - 2)
    fib(n)

if __name__ == "__main__":
    main()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paragon-0.0.5.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file paragon-0.0.5.tar.gz.

File metadata

  • Download URL: paragon-0.0.5.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2

File hashes

Hashes for paragon-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c592842b1ce89d1e0266cb46f47d346e8405f142c40eb242e7b4e3136af71445
MD5 d56d1093b7066211a6276a7d2e6c2cc0
BLAKE2b-256 f6f76e0dc7c586ad036dea50b8fb016329d0d4d1d7666eeb7674f6b4312649ec

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0

1 file

This release

0.0.5 This release

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page