{"id":16406780,"url":"https://github.com/terror/paragon","last_synced_at":"2025-03-23T05:31:22.557Z","repository":{"id":62577821,"uuid":"360974613","full_name":"terror/paragon","owner":"terror","description":"A lightweight command line benchmarking utility","archived":false,"fork":false,"pushed_at":"2021-07-03T02:07:47.000Z","size":91,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T22:03:20.656Z","etag":null,"topics":["benchmarking","python-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-23T18:34:27.000Z","updated_at":"2023-12-15T09:52:32.000Z","dependencies_parsed_at":"2022-11-03T19:32:22.910Z","dependency_job_id":null,"html_url":"https://github.com/terror/paragon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fparagon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fparagon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fparagon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fparagon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terror","download_url":"https://codeload.github.com/terror/paragon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061382,"owners_count":20554563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmarking","python-library"],"created_at":"2024-10-11T06:10:56.228Z","updated_at":"2025-03-23T05:31:22.112Z","avatar_url":"https://github.com/terror.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## \u003cp align='center'\u003eparagon\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  A lightweight command line benchmarking utility (and a python library!)\u003cbr/\u003e\u003cbr/\u003e\n  \u003cimg src=\"https://github.com/terror/paragon/actions/workflows/ci.yml/badge.svg\"/\u003e\n\u003c/p\u003e\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/zlYbpkGncIkB01vqU1BnEh5T0.svg)](https://asciinema.org/a/zlYbpkGncIkB01vqU1BnEh5T0)\n\n## Features\n- Statistical analysis\n- Cool progress bars\n- Python library\n- Export results to various file formats\n\n## Installation\n\nYou can install the command line utility via pip:\n\n```bash\n$ pip install paragon\n```\n\n## Usage\nYou can use paragon as a command line utility or a python library.\n\n### CLI\n\nAfter running --help:\n\n```\nOptions:\n  -a, --accuracy INTEGER  Number of iterations\n  -f, --files PATH        Input file path(s)\n  -o, --output PATH       Output file path\n  --help                  Show this message and exit.\n```\n\n**Examples**:\n\nBenchmarking code as a string:\n```bash\n$ paragon \"print('hello, world')\" -a 20\n```\n\nProviding a python file:\n```bash\n$ paragon -f /path/to/file.py\n```\n\n### Exporting results\n\nYou can use the -o option to specify an ouput file which will receive the results. Paragon currently supports\nMarkdown, CSV and JSON file formats.\n\nFor instance, specifying a Markdown output file will yield this result:\n\n| Program                               | Average [ms] | Min [ms] | Max [ms] |\n|---------------------------------------|--------------|----------|----------|\n| `for i in range(2500): print(i ** i)` | 102.45       | 97.6     | 114.0    |\n| `comp`                                | 230.27       | 226.6    | 236.6    |\n| `hello`                               | 10.23        | 10.1     | 10.5     |\n| `sort`                                | 429.49       | 421.8    | 438.2    |\n\n### Library\n\nExample:\n\n```python\nfrom paragon import Paragon\n\nn = 1000000\n\ndef main():\n    \"\"\"entry point\"\"\"\n    fizzbuzz(n)\n    fib_wrapper(30)\n\n@Paragon.benchmark(name=\"FizzBuzz!\", accuracy=20)\ndef fizzbuzz(n):\n    return list(\n        map(\n            lambda i: \"Fizz\" * (i % 3 == 0) + \"Buzz\" * (i % 5 == 0) or str(i),\n            range(1, n),\n        )\n    )\n\n# You must wrap your recursive functions\n@Paragon.benchmark(name=\"Fibonacci!\", accuracy=20)\ndef fib_wrapper(n):\n    def fib(n):\n        return 1 if n in [0, 1] else fib(n - 1) + fib(n - 2)\n    fib(n)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Further Ramblings\n\nParagon is heavily inspired by the shell benchmarking tool [hyperfine](https://github.com/sharkdp/hyperfine). Although currently less mature, it has room to grow. For now, it is a simple tool that can be used to run quick and easy benchmarks for Python code with minimal setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterror%2Fparagon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterror%2Fparagon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterror%2Fparagon/lists"}