Giter Site home page Giter Site logo

intro-py-profiling's Introduction

Basic introduction to profiling in Python

This is a set of files I used to present a brief introduction to Python profiling, as part of the CCN Coding Club at the Flatiron Institute.

Pre-requisites

Apart from a standard Python 3 installation, some of the code uses the line_profiler and snakeviz packages. You can install these using either pip:

pip install line_profiler
pip install snakeviz

or conda:

conda install -c conda-forge line_profiler
conda install snakeviz

How to use

The notebook profiling_intro.ipynb contains a brief introduction to benchmarking and profiling, and the differences between the two. It also showcases using the line_profiler and snakeviz in a notebook.

The Python scripts are meant to showcase how to profile from the command line. Some of the relevant commands to try can be found in useful_commands.sh.

Other resources

A tutorial on Python profiling: https://jakevdp.github.io/PythonDataScienceHandbook/01.07-timing-and-profiling.html

More info on profiling: https://lyz-code.github.io/blue-book/python_profiling/

Documentation for snakeviz: https://jiffyclub.github.io/snakeviz/

Reference for profile module: https://docs.python.org/3/library/profile.html

Repository and documentation for line_profiler: https://github.com/pyutils/line_profiler

Profiling in pytorch: https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html

List of Jupyter built-in magics: https://ipython.readthedocs.io/en/stable/interactive/magics.html

intro-py-profiling's People

Contributors

ttesileanu avatar

Stargazers

Eric Thomson avatar

Watchers

 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.