Profiling web-edit with Python 3.15: flame graphs and source heatmaps

Simon Willison's Blog News

Summary

Simon Willison profiles his new web-edit app using Python 3.15's built-in sampling profiler, revealing that mixed line-ending preservation dominated CPU time, and demonstrates how to generate flame graphs and source heatmaps with the new tooling.

No content available
Original Article
View Cached Full Text

Cached at: 10/13/26, 10:48 PM

# Research: Profiling web-edit with Python 3.15: flame graphs and source heatmaps Source: [https://simonwillison.net/2026/Oct/12/python-3-15-web-edit-profiling/](https://simonwillison.net/2026/Oct/12/python-3-15-web-edit-profiling/) [Research](https://simonwillison.net/elsewhere/research/)[Profiling web\-edit with Python 3\.15: flame graphs and source heatmaps](https://github.com/simonw/research/tree/main/python-3-15-web-edit-profiling#readme)— 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](https://simonwillison.net/2026/Oct/12/python-3-15/#a-sampling-profiler)through its paces by having GPT\-6 Astra Extra High in Codex run it against my new[web\-edit app](https://simonwillison.net/2026/Oct/12/web-edit/): > `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](https://simonw.github.io/research/python-3-15-web-edit-profiling/artifacts/flamegraph.html)and[heatmap](https://simonw.github.io/research/python-3-15-web-edit-profiling/artifacts/heatmap/index.html)\.

Similar Articles

Profiling.sampling – Statistical Profiler

Hacker News Top

Python 3.15 introduces the profiling.sampling module, Tachyon, a statistical profiler that periodically samples stack snapshots with minimal overhead, suitable for development and production environments.