Linux's Perf Script Command Much Faster With Overhaul As Python Module

Written by Michael Larabel in Programming on 21 September 2026 at 05:57 AM EDT. 8 Comments
PROGRAMMING
A big patch series sent out this weekend for the Linux kernel's perf subsystem removes the embedded Python and Perl scripting in favor of standalone Python scripts with a new Python perf module. This perf module for Python written in C is much faster than the status quo.

Google engineer Ian Rogers has carried out the overhaul of the perf script command to address its high overhead, complex build dependencies, and other design challenges by creating a proper perf module for Python. With this perf Python C extension module there is much faster performance such as a Python script previously taking 3.7 seconds to now just 0.1 seconds with a standalone Python script and using the new perf module.

Linux perf Python benchmark improvement


The set of 49 patches sent out on Saturday transition the Python perf code to using the new perf module as well as dropping the old libpython-based code and legacy Python scripts. It's a ~21k lines of code overhaul for improving the Linux perf scripting process. Gemini 3.1 Pro assisted Rogers with this overhaul.

Those making use of Linux perf with Python scripting can learn more about this fundamental change currently under review on the mailing list via this patch series.
Related News
About The Author

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week