Triangulating Python Performance Issues with Scalene

Emery D. Berger, Sam Stern, Juan Altmayer Pizzorno
12/15/2022
28 citations
cs.PLcs.PF

Official code: plasma-umass/scalene (13,537 stars, Python, Apache-2.0, last commit 2026-05-03).

Abstract

This paper proposes Scalene, a profiler specialized for Python. Scalene combines a suite of innovations to precisely and simultaneously profile CPU, memory, and GPU usage, all with low overhead.

Show full abstract

Scalene's CPU and memory profilers help Python programmers direct their optimization efforts by distinguishing between inefficient Python and efficient native execution time and memory usage. Scalene's memory profiler employs a novel sampling algorithm that lets it operate with low overhead yet high precision. It also incorporates a novel algorithm that automatically pinpoints memory leaks, whether within Python or across the Python-native boundary. Scalene tracks a new metric called copy volume, which highlights costly copying operations that can occur when Python silently converts between C and Python data representations, or between CPU and GPU. Since its introduction, Scalene has been widely adopted, with over 500,000 downloads to date. We present experience reports from developers who used Scalene to achieve significant performance improvements and memory savings.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals

13,537445Python, JavaScriptDec 17, 20197 months agoApache-2.0
cpucpu-profilinggpugpu-programmingmemory-allocation+9 more

Similar Papers

Cite this paper

@article{berger2022triangulating,
  title  = {Triangulating Python Performance Issues with Scalene},
  author = {Emery D. Berger and Sam Stern and Juan Altmayer Pizzorno},
  year   = {2022},
  eprint = {2212.07597},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.07597}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2212.07597.svg)](https://codeofpaper.com/paper/2212.07597)

Discussion