Python 3.15 Profiling Reveals Hotspots in the web-edit App
Reading lead
Simon Willison tested Python 3.15’s built-in sampling profiler on the web-edit app, asking GPT-6 Astra Extra High in Codex to research the app and produce a flame graph and source heatmap. The reported profile used an editing workload and recorded 15,296 CPU stacks. Mixed line-ending preservation was the largest identified hotspot: `preserve_endings` appeared in 64.8% of stacks, while `SequenceMatcher.find_longest_match` accounted for 38.3% of leaf samples. The write-up also notes that profiling all threads mattered: 95.1% of stacks came from an AnyIO worker thread and would not have appeared in a main-thread-only profile. This is a concrete profiling demonstration and set of diagnostic findings, not evidence of an optimization or a general performance result for Python 3.15 or web-edit.
Article body
Research Profiling web-edit with Python 3.15: flame graphs and source heatmaps — Profiling the unmodified web-edit app with Python 3.15’s built-in `profiling.sampling` revealed that mixed line-ending preservation dominated a busy editing workload: `preserve_endings` appeared in 64.8% of 15,296 recorded CPU stacks, with `SequenceMatcher.find_longest_match` contributing 38.3% of leaf samples. Sampling all threads was essential, since 95.1% of stacks came from AnyIO’s worker thread and would have been missed by a main-thread-only profile.
I put the new Python 3.15 profiler through its paces by having GPT-6 Astra Extra High in Codex run it against my new web-edit app:
I need a Python 3.15 flame graph and heatmap demo of the "web-edit" app from PyPI - research first then make me those demos
Here's the resulting example flame graph and heatmap.
Source: ·Simon Willison · 2026-10-12T16:58:00.000Z · Read the original article
Why read this
The post provides specific profiler findings and a useful warning about worker-thread sampling, but reports one app and workload without demonstrating a performance fix or broader benchmark.
AI score 51 · View scoring rationale
Two-model scores assess source reading value, not factual accuracy. Check this editorial article against the original.
- gpt-6-luna-2026-09-22 · 48
The post provides specific profiler findings and a useful warning about worker-thread sampling, but reports one app and workload without demonstrating a performance fix or broader benchmark.
- deepseek-flash · 54
Python 3.15 sampling profiler applied to one app reveals a concrete preserve_endings/SequenceMatcher hotspot and a thread-sampling caveat, but evidence is a single author-reported run with no independent verification or broader benchmark.
Analyzed: 2026.10.14 03:50 UTC
Comments & answers 0