Modern Approaches to Profiling in Python with Scalene

Python is a language developers choose to write in for convenience rather than speed. However, speed can be recovered by offloading calculations to libraries which leverage lower level languages like NumPy, Cython, and more. Scalene is a high-performance CPU, GPU, and memory profiler which can illustrate where code should be passing calculations to other libraries for significant increases in speed. Scalene also includes support for Jupyter Notebooks, OpenAI suggestions for vectorizing code, as well as a significantly lower overhead and higher accuracy than other profilers. This talk will introduce the concepts required for understanding why external libraries are faster than native Python, interactions with approaches such as Cython and Just-in-Time compilers, as well as a live demonstration of Scalene on the Alliance systems inside of a Jupyter Notebook. Familiarity with Python, virtual environments, and Jupyter notebooks will be assumed. Code and slides: https://github.com/Andesha/sharcnet-c... _______________________________________­________ This webinar was presented by Tyler Collins (SHARCNET) on May 3rd, 2023, as a part of a series of weekly Compute Ontario Colloquia. The webinar was hosted by SHARCNET. The colloquia cover different advanced research computing (ARC) and high performance computing (HPC) topics, are approximately 45 minutes in length, and are delivered by experts in the relevant fields. Further details can be found on this web page: https://www.computeontario.ca/trainin... . Recordings, slides, and other materials can be found here: https://helpwiki.sharcnet.ca/wiki/Onl... SHARCNET is a consortium of 19 Canadian academic institutions who share a network of high performance computers (http://www.sharcnet.ca). SHARCNET is a part of Compute Ontario (http://computeontario.ca/) and Digital Research Alliance of Canada (https://alliancecan.ca).

CUDA, ROCm, oneAPI – All for One or One for All?
▶︎

CUDA, ROCm, oneAPI – All for One or One for All?

When Python Practices Go Wrong - Brandon Rhodes - code::dive 2019
▶︎

When Python Practices Go Wrong - Brandon Rhodes - code::dive 2019

Scalene: a high-performance, high-precision CPU+GPU+memory profiler for Python (PyCon US 2021)
▶︎

Scalene: a high-performance, high-precision CPU+GPU+memory profiler for Python (PyCon US 2021)

"Performance Matters" by Emery Berger
▶︎

"Performance Matters" by Emery Berger

"Python Performance Matters" by Emery Berger (Strange Loop 2022)
▶︎

"Python Performance Matters" by Emery Berger (Strange Loop 2022)

"See CPython run: Getting to know your Python interpreter" - James Bennett (North Bay Python 2019)
▶︎

"See CPython run: Getting to know your Python interpreter" - James Bennett (North Bay Python 2019)

Pro tips for writing great unit tests - Raymond Hettinger
▶︎

Pro tips for writing great unit tests - Raymond Hettinger

Zig 2026: No-AI Policy, $670K Foundation, Left GitHub & Why Zig Isn’t 1.0 - Andrew Kelley Explains
▶︎

Zig 2026: No-AI Policy, $670K Foundation, Left GitHub & Why Zig Isn’t 1.0 - Andrew Kelley Explains

Measuring Multiple Facets of Python Performance With Scalene | Real Python Podcast #172
▶︎

Measuring Multiple Facets of Python Performance With Scalene | Real Python Podcast #172

Writing Faster Python 3 - presented by Sebastian Witowski
▶︎

Writing Faster Python 3 - presented by Sebastian Witowski

OpenCV Course - Full Tutorial with Python
▶︎

OpenCV Course - Full Tutorial with Python

Raymond Hettinger - Super considered super! - PyCon 2015
▶︎

Raymond Hettinger - Super considered super! - PyCon 2015

Raymond Hettinger - Dataclasses:  The code generator to end all code generators - PyCon 2018
▶︎

Raymond Hettinger - Dataclasses: The code generator to end all code generators - PyCon 2018

Transforming Code into Beautiful, Idiomatic Python
▶︎

Transforming Code into Beautiful, Idiomatic Python

Raymond Hettinger - Modern solvers: Problems well-defined are problems solved - PyCon 2019
▶︎

Raymond Hettinger - Modern solvers: Problems well-defined are problems solved - PyCon 2019

David Beazley - Python Concurrency From the Ground Up: LIVE! - PyCon 2015
▶︎

David Beazley - Python Concurrency From the Ground Up: LIVE! - PyCon 2015

Robert Smallshire - Domain Driven Design Patterns in Python
▶︎

Robert Smallshire - Domain Driven Design Patterns in Python

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup
▶︎

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

Talk - Anthony Shaw: Write faster Python! Common performance anti patterns
▶︎

Talk - Anthony Shaw: Write faster Python! Common performance anti patterns

Make Python code 1000x Faster with Numba
▶︎

Make Python code 1000x Faster with Numba