Python Bytes artwork

Python Bytes · Michael Kennedy and Calvin Hendryx-Parker

#497 Faster than light profiling

Topics covered in this episode: Tachyon: A sampling profiler ships in Python 3.15's stdlib Python Workers are now generally available on Cloudflare Flet 1.0 - build cross-platform apps in Python marimo-book: Build static books from marimo notebooks Extras Joke Watch on YouTube Sponsored by Logfire from Pydantic: pythonbytes.fm/logfire Connect with the hosts Michael: Mastodon / BlueSky / X / LinkedIn Calvin: Mastodon / BlueSky / X / LinkedIn Show: Mastodon / BlueSky / X Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesday at 7am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Tachyon: A sampling profiler ships in Python 3.15's stdlib Python 3.15 adds the profiling package per PEP 799: profiling.tracing (where cProfile moved) and profiling.sampling, the new sampler called Tachyon py-spy and Austin exist but copy raw interpreter bytes with no API, so every CPython release risks breaking them; one in the stdlib is a contract to stop breaking profilers Defaults: 1 kHz, main thread, wall clock, and a -live top-like view for poking at a slow server Output is flexible: pstats, -flamegraph, -diff-flamegraph against a baseline, -heatmap on source lines, -opcodes for specialized bytecode, -gecko for Firefox Profiler with GIL and GC markers Profiling modes: wall, cpu, gil (which function is starving my other threads?), and exception, plus -async-aware to see the task graph instead of just select(), -all-threads, and -subprocesses forking a profiler per child Near-zero overhead for production; guidance is 10-30 second windows on representative load, and free-threaded builds divide the rate by thread count Attach to a running PID, same minor version only; ptrace permissions are the main friction. A 3.14 backport already exists on GitHub Caveat: it only sees Python frames, so 90% in calculate() hides NumPy underneath. For native stacks there's Cronon from HRT, 200k samples/sec over DWARF, not yet open source Calvin #2: Python Workers are now generally available on Cloudflare Python Workers are out of beta - now GA, "first-class" language on Cloudflare's Developer Platform No more manual JS interop: bindings (queues, R2, D1, Durable Objects) now work natively in Python, e.g. self.env.QUEUE.send({...}) Runs on Pyodide (WASM-compiled Python), with real TCP socket support for DB connectivity Frameworks supported: FastAPI, Django, Flask; AI libs like OpenAI SDK, LangChain, MCP Underlying platform work formalized as PEP 783 (PyEmscripten), after a year of discussion Bottom line: write real Python on Cloudflare's edge, no JS glue code required Calvin #3: Flet 1.0 - build cross-platform apps in Python Flet hits 1.0 - build Flutter-backed apps from pure Python, no frontend experience needed One codebase targets six...

Sep 232026
26 minlength
496transcript lines
Publishertranscript source

Transcript first 15 of 496 lines

0:00Speaker 1Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

0:05Speaker 1This is episode 497, recorded September 22nd, 2026.

0:11Speaker 1I'm Calvin Hendryx-Parker.

0:12Speaker 1And I'm Michael Kennedy.

0:14Speaker 1Excellent, Michael.

0:15Speaker 1I think you get a little message here you want to give.

0:17Speaker 2This episode is brought to you by Logfire from Pydantic.

0:20Speaker 2Check them out at pythonbytes.fm/logfire.

0:24Speaker 2They are super, they're a great company, you know, Samuel and team.

0:29Speaker 2Pydantic has been a good community member, and this is a really great way to add observability to your app.

0:34Speaker 2I will tell you more about that later.

0:36Speaker 2Perfect.

0:36Speaker 2Right now, connect us, Calvin.

0:38Speaker 1Yeah, I will.

0:39Speaker 1You should connect with Michael and I and the show.

More Python Bytes episodes →