Stepcounter is a performance measurement tool designed to assess the efficiency of Python code.
- Python 3.10 or higher
- pip version 22 or higher
Clone this repository:
git clone https://github.com/jsmid1/python-step-counter.gitMove to the root folder of the project (Replace "/path/to/clone" with the actual path):
cd /dir/with/clone/python-step-counterInstall the package:
pip install .For installation on a Linux system, you may install directly from PyPi:
pip install stepcounterAfter installation, you may use the tool with:
stepcounter /path/to/tested/fileThe tool offers 3 modes of operation selectable with -m or --mode:
- DEFAULT mode outputs only the score of a program.
- SEQUENCE mode gives information about the order of function calls.
- DETAIL mode outputs detailed profile of a program for each line.
If you wish to output to directory instead of stdout use -o or --output_dir.
stepcounter /path/to/tested/file -m=DETAIL -o=/path/to/output/dir- Python development package for tested version (e.g.
python3.10-dev) - Setuptools module installed for tested version (can be installed with
pip install setuptools)
To run all tests, execute this command in the root directory (Replace version with the Python version you wish to test):
bash tests/test_run.sh versionThis script sets up the environment and runs all tests.
If you wish to run a specific test run the setup:
python setup.py build_ext --inplaceand then use (Replace "/path/to/the/testfile" with the actual path):
python -m unittest /path/to/the/testfile This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
Jan Šmíd - jsmid1