Papers › Scalene: Scripting-Language Aware Profiling for Python

Scalene: Scripting-Language Aware Profiling for Python

6 Jun 2020arXiv:2006.03879links table onlyarchive 2025-07-28

Emery D. Berger

The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.

Existing profilers for scripting languages (a.k.a. "glue" languages) like Python suffer from numerous problems that drastically limit their usefulness. They impose order-of-magnitude overheads, report information at too coarse a granularity, or fail in the face of threads. Worse, past profilers---essentially variants of their counterparts for C---are oblivious to the fact that optimizing code in scripting languages requires information about code spanning the divide between the scripting language and libraries written in compiled languages. This paper introduces scripting-language aware profiling, and presents Scalene, an implementation of scripting-language aware profiling for Python. Scalene employs a combination of sampling, inference, and disassembly of byte-codes to efficiently and precisely attribute execution time and memory usage to either Python, which developers can optimize, or library code, which they cannot. It includes a novel sampling memory allocator that reports line-level memory consumption and trends with low overhead, helping developers reduce footprints and identify leaks. Finally, it introduces a new metric, copy volume, to help developers root out insidious copying costs across the Python/library boundary, which can drastically degrade performance. Scalene works for single or multi-threaded Python code, is precise, reporting detailed information at the line granularity, while imposing modest overheads (26%--53%).

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2006.03879")

Code

Syntology Ran 0 of 8 code samples harvested from 1 repository linked to this paper; 8 have no recorded run.

By repository: community (archive-listed): 8 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

emeryberger/scalene officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
plasma-umass/scalene mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

8 samples harvested; 0 ran; 0 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

8unverified

Licence: 0 of the 8 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from plasma-umass/scalene. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

c_time_ns plasma-umass/scalene/formal/extract/scalene_verified_core.py community (archive-listed) unverified Apache-2.0 (permissive) · 66d17e57fe909242 · report
calculate_cpu_sample_overlap plasma-umass/scalene/scalene/merge_scalene_neuron_profiles.py community (archive-listed) unverified Apache-2.0 (permissive) · 6fcbd478f92ee8a4 · report
find_browser plasma-umass/scalene/scalene/find_browser.py community (archive-listed) unverified Apache-2.0 (permissive) · 43834758f9135854 · report
is_port_available plasma-umass/scalene/scalene/launchbrowser.py community (archive-listed) unverified Apache-2.0 (permissive) · 6489438902cab01b · report
parse_debug_file_programmatic plasma-umass/scalene/scalene/merge_scalene_neuron_profiles.py community (archive-listed) unverified Apache-2.0 (permissive) · 1709eb2d4fa52616 · report
python_fraction_ppm plasma-umass/scalene/formal/extract/scalene_verified_core.py community (archive-listed) unverified Apache-2.0 (permissive) · c1321ba24a648f33 · report
redirect_python plasma-umass/scalene/scalene/redirect_python.py community (archive-listed) unverified Apache-2.0 (permissive) · aeccfddf8e80d5eb · report
total_time_ns plasma-umass/scalene/formal/extract/scalene_verified_core.py community (archive-listed) unverified Apache-2.0 (permissive) · 8f8ec43e049de332 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections