core.py

The Megahertz

10 snips
Jul 12, 2025
Discover the exciting new built-in sampling profiler introduced in Python 3.15, revolutionizing how developers analyze performance. Dive into the complexities of profiling AsyncIO applications and the challenges of multi-threaded environments. The conversation also highlights the launch of memory.python.org and the advancements in profiling tools, including the benefits of efficient sampling to reduce overhead. Enjoy a light-hearted take on the technical intricacies and common misconceptions surrounding hashing and performance optimization!
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Tracing vs Sampling Profilers

  • Tracing profilers introduce high overhead by stopping program execution at every call and return.
  • Sampling profilers provide a statistical understanding of program hotspots with significantly less overhead.
ADVICE

Avoid Using Tracing Profilers

  • Avoid using Python tracing profilers like profile due to high overhead and complexity.
  • Prefer the new sampling profiler for better accuracy and minimal performance impact.
ANECDOTE

Profiling the Profiler on macOS

  • Pablo used Apple's Instruments on macOS to profile the sampler's initial performance.
  • He discovered it ran at only 3 Hz initially, which was later optimized to 10,000 Hz and beyond.
Get the Snipd Podcast app to discover more snips from this episode
Get the app