4.1 Article

Quantifying the interpretation overhead of Python

Journal

SCIENCE OF COMPUTER PROGRAMMING
Volume 215, Issue -, Pages -

Publisher

ELSEVIER
DOI: 10.1016/j.scico.2021.102759

Keywords

Python; Interpreter; CPython; Overhead; Performance analysis

Funding

  1. NSFC [61832009]
  2. Jiangsu Postgraduate Innovation Program [KYCX20_0042]
  3. Cooperation Fund of Huawei-Nanjing University Next Generation Programming Innovation Lab [YBN2019105178SW27]
  4. NSF [1901242, 1910300]
  5. ONR [N000141712045, N000141410468, N000141712947]

Ask authors/readers for more resources

This study conducted empirical research on CPython's performance through sampling-based profiling, revealing that a small portion of the code affects performance, with potential improvements lying in areas such as name access opcodes and reference counting functions.
While Python has become increasingly popular for its convenience, it is also criticized for its suboptimal performance. To figure out what burdens the interpreter of Python and provide insights into possible optimizations, we conduct this empirical study on CPython's performance via sampling-based profiling. This sampling-based approach incurs a low runtime overhead and does not require any modification of the interpreter and the application code, thus providing convincing experimental results. Specifically, we use 48 benchmarks from the pyperformance project to analyze the runtime overhead of the interpreter. We compare the usage of different opcodes and decompose the overhead at various granularities (e.g., files, functions, and statements). It turns out that most parts contribute a small portion of the overhead, and the promising improvements lie in the minority, such as name access opcodes and reference counting functions. Furthermore, we pay attention to four specific performance-affecting issues: name access, dynamic typing, garbage collection, and opcode dispatch. The issue study reveals several promising optimization techniques, such as register-based virtual machine architecture and tracing based garbage collection, as well as a few fruitless optimization points, such as operator overloading and dispatch. (c) 2021 Elsevier B.V. All rights reserved.

Authors

I am an author on this paper
Click your name to claim this paper and add it to your profile.

Reviews

Primary Rating

4.1
Not enough ratings

Secondary Ratings

Novelty
-
Significance
-
Scientific rigor
-
Rate this paper

Recommended

No Data Available
No Data Available