← All IntelIntel / article
Profiling web-edit with Python 3.15: flame graphs and source heatmaps
- Source
- simonwillison.net
- Date
Context
Profiling only the main thread would have missed almost all the recorded CPU activity in Simon Willison's web-edit experiment. Using Python 3.15's sampling profiler, he reports that 95.1% of the captured execution snapshots came from a background worker thread. Preserving mixed newline formats appeared in 64.8% of all recorded stacks, identifying a concrete place to investigate the editing workload's cost. Experiment report.
The result is a diagnosis of the unmodified application. Sampling every thread exposed work that a narrower measurement would have overlooked; the report does not measure a speedup from changing that code. Profiling findings.
Key takeaways · AI-distilled
- Simon Willison had GPT-6 Astra in Codex run Python 3.15's built-in profiling.sampling module against his web-edit app, producing a flame graph and a source heatmap.
- Mixed line-ending preservation dominated a busy editing workload: preserve_endings appeared in 64.8% of 15,296 recorded CPU stacks, and SequenceMatcher.find_longest_match accounted for 38.3% of leaf samples.
- 95.1% of stacks came from AnyIO's worker thread, so a profile that sampled only the main thread would have missed the hotspot.
Terms in this piece · Glossary
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
Read the source simonwillison.net
Recommended reads
Comments
Checking sign-in…
Loading comments…

