GithubHelp home page GithubHelp logo

hsenrab / cprofilev Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ymichael/cprofilev

0.0 2.0 0.0 48 KB

:fire: An easier way to use cProfile

Home Page: https://pypi.python.org/pypi/CProfileV

License: MIT License

Python 100.00%

cprofilev's Introduction

cprofilev

An easier way to use cProfile.

about

cprofilev runs and profiles a given python program and outputs a simple html view of the statistics collected.

See: http://ymichael.com/2014/03/08/profiling-python-with-cprofile.html on how to make sense of the profiled statistics.

installation

on most UNIX-like systems, you'll probably need to run the following `install` command as root or by using sudo

pip install cprofilev

quickstart

  1. Simply run your python program in with the -m cprofilev flag.
$ python -m cprofilev /path/to/python/program ...
  1. Navigate to http://localhost:4000 to view profile statistics of your python program (even while its still running!)

Alternatively you can output view cprofile output using the -f flag:

# NOTE this is cProfile not cprofilev
$ python -m cProfile -o /path/to/save/output /path/to/python/program ...
$ cprofilev -f /path/to/save/output

usage

usage: cprofilev.py [--version] [-a ADDRESS] [-p PORT] scriptfile [arg] ...

An easier way to use cProfile.

positional arguments:
  scriptfile            The python script file to run and profile.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -a ADDRESS, --address ADDRESS
                        The address to listen on. (defaults to 127.0.0.1).
  -p PORT, --port PORT  The port to listen on. (defaults to 4000).
  -f FILE, --file FILE  cProfile output to view.
                        If specified, the scriptfile provided will be ignored.

Dependencies

bottle: used for serving the html page.

Development

To quickly contribute to cprofilev, you can use this example as a means to profile things:

python -m cprofilev example_for_profiling.py

cprofilev's People

Contributors

ymichael avatar matthieu-bruneaux avatar alanc10n avatar cburmeister avatar virtuald avatar fabricesalvaire avatar dizballanze avatar zvickery avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.