Skip to content

jsmid1/python-step-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published