#497: Faster than light profiling
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
profilingpackage per PEP 799:profiling.tracing(where cProfile moved) andprofiling.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
-livetop-like view for poking at a slow server - Output is flexible: pstats,
-flamegraph,-diff-flamegraphagainst a baseline,-heatmapon source lines,-opcodesfor specialized bytecode,-geckofor Firefox Profiler with GIL and GC markers - Profiling modes: wall, cpu, gil (which function is starving my other threads?), and exception, plus
-async-awareto see the task graph instead of justselect(),-all-threads, and-subprocessesforking 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 platforms: iOS, Android, Windows, macOS, Linux, web
- 150+ built-in UI controls, plus support for custom controls / wrapping Flutter packages
- Mobile now supports real Python packages: NumPy, pandas, Pillow, cryptography
- Comes with pytest-based UI testing and an MCP integration for AI coding assistants
- Milestone lands 4+ years after its first PyPI release (Sept 2022) - signals "production ready," not experimental
Michael #4: marimo-book: Build static books from marimo notebooks
marimo-book is a Jupyter-Book-style static site generator built specifically for marimo .py notebooks. It ships polished multi-page sites with Material for MkDocs theming, full-text search, dark mode, and code copy, plus a content-hashed incremental build cache that drops rebuilds from 100+ seconds to roughly 3 seconds on real books. Standout extras include anywidget rendering without a kernel, static reactivity for discrete sliders via pre-rendered lookup tables, an opt-in WASM/Pyodide mode per chapter, and per-chapter launch buttons.
- If you've wanted to publish a marimo notebook as a real book or course site without hosting a kernel, marimo-book gives you the static, searchable, fast-loading output you'd expect from Jupyter Book.
- Alpha (0.1.x), but in production: pin marimo-book>=0.1.5,<0.2; the book.yml schema is stable for v0.1, and dartbrains.org is a real-world user.
- Two-stage build by design: a marimo-aware preprocessor emits plain Markdown + inline HTML, then mkdocs (Material today, zensical tomorrow) renders it. Not a mkdocs plugin, so the shell stays swappable.
- Interactive widgets without a kernel: anywidget Canvas/Three.js/Plotly mounts render statically, and mo.ui.slider with explicit steps gets pre-computed as a static lookup table.
- WASM escape hatch per chapter: set mode: wasm and the chapter routes through marimo's MarimoIslandGenerator, shipping the marimo runtime + Pyodide bundle for full reactivity where you need it.
- Per-chapter launch buttons and extras: readers can jump to molab, GitHub, or a downloaded .py; optional [social], [linkcheck], and [pdf] extras cover OG cards, htmlproofer, and WeasyPrint PDF export.
- Sandboxed notebooks: the sandbox mode reads PEP 723 inline metadata and provisions per-notebook envs via uv for portable builds, at the cost of slower first runs.
Extras
Calvin:
- Great overview of a new feature in Python 3.15 - frozendict
Michael:
- Microsoft Plugs Nearly 1,000 Security Holes in Windows
- I’ll be speaking at PyBay 2026
- PyCon NL on October 15 in Utrecht
- Heading to Europe in October? PyCon NL is October 15th in Utrecht. One day, three tracks, about 350 people. It's an hour by train from Schiphol. There's also a session just for community organizers from groups like PyLadies, PyData, and Django. And the location fits. The Netherlands is where Python itself was born.
Joke: You have homework (no really ;) )
Watch Interview with Big Data engineer in 2026 by Kai Lentit
Episode Transcript
Collapse transcript
00:00
00:05
00:11
00:12
00:14
00:15
00:17
00:20
00:24
00:29
00:34
00:36
00:36
00:38
00:39
00:41
00:45
00:52
00:54
00:58
01:01
01:12
01:17
01:18
01:21
01:22
01:24
01:28
01:29
01:31
01:39
01:41
01:43
01:48
01:49
01:50
01:58
02:12
02:13
02:15
02:16
02:16
02:21
02:24
02:28
02:32
02:32
02:35
02:37
02:38
02:40
02:40
02:50
02:51
02:55
03:01
03:03
03:05
03:10
03:11
03:11
03:13
03:23
03:27
03:31
03:40
03:41
03:44
03:45
03:48
03:49
03:50
04:01
04:05
04:08
04:10
04:10
04:18
04:21
04:22
04:29
04:30
04:31
04:31
04:32
04:33
04:34
04:35
04:36
04:37
04:38
04:40
04:41
04:42
04:46
04:48
04:51
04:55
04:57
05:01
05:10
05:10
05:15
05:17
05:18
05:22
05:24
05:27
05:30
05:34
05:37
05:38
05:40
05:42
05:43
05:45
05:48
05:50
05:53
05:54
05:55
05:55
06:03
06:08
06:10
06:17
06:22
06:32
06:38
06:47
06:53
07:00
07:15
07:21
07:25
07:31
07:42
07:55
08:01
08:05
08:08
08:14
08:16
08:18
08:26
08:29
08:38
08:39
08:40
08:43
08:53
08:58
09:10
09:13
09:15
09:21
09:23
09:25
09:27
09:32
09:40
09:50
09:58
10:03
10:10
10:14
10:15
10:22
10:25
10:27
10:33
10:36
10:48
10:58
11:04
11:08
11:15
11:16
11:16
11:18
11:23
11:26
11:29
11:30
11:38
11:49
11:54
11:55
12:01
12:02
12:07
12:10
12:14
12:15
12:21
12:25
12:27
12:28
12:35
12:36
12:38
12:39
12:39
12:40
12:42
12:43
12:46
12:47
12:51
12:54
12:56
13:09
13:10
13:11
13:12
13:13
13:15
13:17
13:21
13:22
13:29
13:33
13:35
13:39
13:42
13:45
13:49
13:50
13:51
13:52
13:54
13:57
13:59
14:00
14:03
14:05
14:06
14:10
14:10
14:12
14:13
14:16
14:18
14:20
14:20
14:24
14:24
14:25
14:26
14:27
14:31
14:39
14:49
14:52
14:53
14:55
15:05
15:09
15:11
15:22
15:37
15:46
15:53
16:01
16:04
16:11
16:15
16:20
16:23
16:26
16:29
16:31
16:34
16:39
16:41
16:43
16:46
16:46
16:49
16:50
16:50
16:56
16:59
17:02
17:07
17:08
17:10
17:11
17:14
17:20
17:25
17:27
17:27
17:28
17:29
17:30
17:31
17:32
17:34
17:35
17:36
17:42
17:43
17:46
17:47
17:47
17:48
17:53
17:54
17:59
18:01
18:02
18:08
18:10
18:11
18:12
18:14
18:16
18:18
18:20
18:24
18:25
18:26
18:31
18:35
18:37
18:47
18:49
18:50
18:51
18:52
18:52
18:53
18:53
18:57
19:03
19:11
19:15
19:17
19:22
19:24
19:26
19:26
19:27
19:30
19:33
19:38
19:39
19:43
19:45
19:48
19:56
19:58
20:01
20:02
20:03
20:04
20:05
20:06
20:11
20:16
20:19
20:29
20:30
20:31
20:32
20:33
20:37
20:38
20:39
20:45
20:50
20:52
20:56
21:00
21:07
21:08
21:08
21:11
21:13
21:16
21:17
21:25
21:26
21:34
21:36
21:37
21:39
21:40
21:46
21:51
21:53
21:54
21:58
21:58
22:04
22:05
22:07
22:09
22:12
22:19
22:23
22:25
22:25
22:27
22:38
22:45
22:47
22:47
22:49
22:54
22:54
23:03
23:06
23:09
23:12
23:15
23:17
23:20
23:23
23:25
23:29
23:34
23:35
23:36
23:36
23:37
23:38
23:45
24:00
24:05
24:06
24:08
24:10
24:13
24:18
24:28
24:30
24:36
24:41
24:46
24:48
24:50
24:51
24:53
24:54
24:55
24:55
24:56
24:57
24:59
24:59
25:02
25:04
25:08
25:10
25:14
25:19
25:28
25:33
25:36
25:36
25:38
25:39
25:41
25:47
25:49
25:51
25:53
25:53
25:55
26:00
26:08
26:12
26:14
26:16
26:20
26:23
26:26
26:30
26:32
26:32
26:33
26:34
26:37
26:37
26:38
26:39
26:42
26:42
26:45
26:47
26:47


