Profiling.sampling – Statistical Profiler

Python gets a near-zero slowdown checker, and the comments instantly turned into a fight

TLDR: Python 3.15 adds Tachyon, a built-in tool that can spot slow parts of a running program with almost no slowdown and no restart. Commenters were split between cheering the convenience, comparing it to existing tools, and reigniting the eternal drama over whether Python should even be used for speed-heavy work.

Python just rolled out Tachyon, a new built-in tool in version 3.15 that watches a program from the outside and estimates where it’s spending time. In plain English: it helps developers spot what’s slowing things down without changing the code or restarting the app, which is why several commenters reacted with a very relieved “finally.” One of the loudest vibes in the room was basically, why was this not already included? A few people compared it to existing third-party tools and celebrated that Python is now shipping something like this “out of the box.”

But of course, the comment section could not simply be normal. One camp loved the convenience, while another immediately pointed out a catch: unlike Python’s older tracing tool, this one lives outside your app, so you can’t weave it into the program itself as easily. That sparked a mini philosophy battle over whether a profiler should be a built-in feature you can ship or an external detective you attach later.

Then came the classic internet detour: if Python is slow, why use Python at all? That hot take predictably invited eye-roll energy, because the whole point of Tachyon is helping people make real-world Python apps faster, not hold a language identity crisis in the comments. Meanwhile, others got practical and asked whether it can handle modern async workloads, aka the messy reality of one request juggling many tasks. So yes, the tool announcement was cool — but the real show was the community instantly splitting into the “finally!”, “isn’t this just py-spy?”, and “why are you using Python then?” factions.

Key Points

  • Python 3.15 adds the `profiling.sampling` module, named Tachyon, for statistical profiling via periodic stack sampling.
  • Tachyon can run scripts directly or attach to running Python processes without requiring code changes or restarts.
  • The profiler estimates execution time from how often functions appear in collected samples rather than measuring each call directly.
  • Accuracy improves with more samples, so longer profiling sessions and shorter sampling intervals yield more reliable estimates.
  • The article recommends `profiling.tracing` or `timeit` instead of sampling for very short scripts, exact call counts, or micro-benchmark comparisons.

Hottest takes

"very nice to get it out of the box in 3.15" — krystalgamer
"That turns tracing into a feature you can ship" — wongarsu
"So for performance-critical code, why use Python?" — thomasmg
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.