Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 2.15 KB

File metadata and controls

86 lines (66 loc) · 2.15 KB

Stepcounter

Stepcounter is a performance measurement tool designed to assess the efficiency of Python code.

Table of Contents

Prerequisites

  • Python 3.10 or higher
  • pip version 22 or higher

Installation

Clone this repository:

git clone https://github.com/jsmid1/python-step-counter.git

Move to the root folder of the project (Replace "/path/to/clone" with the actual path):

cd /dir/with/clone/python-step-counter

Install the package:

pip install .

Alternatives

For installation on a Linux system, you may install directly from PyPi:

pip install stepcounter

Usage

After installation, you may use the tool with:

stepcounter /path/to/tested/file

Configuration

The 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.

Example usage

stepcounter /path/to/tested/file -m=DETAIL -o=/path/to/output/dir

Testing

Prerequisites

  • 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 version

This 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 --inplace

and then use (Replace "/path/to/the/testfile" with the actual path):

python -m unittest /path/to/the/testfile        

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

Authors

Jan Šmíd - jsmid1