Python 3.15’s profiler finds line-ending code dominates web-edit app
Simon Willison profiled a Python 3.15 web-edit app using built-in sampling tools. The app’s preserveendings feature consumed 64.8% of CPU time across 15,296 recorded stacks, with SequenceMatcher.findlongestmatch accounting for 38.3% of leaf samples. Sampling all threads was critical, as 95.1% of stacks originated from AnyIO’s worker thread, which would have been missed by profiling only the main…
Key points
- Python 3.15’s profiler shows `preserve_endings` uses 64.8% of CPU in web-edit app
- `SequenceMatcher.find_longest_match` takes 38.3% of leaf samples in profiling data
- AnyIO’s worker thread accounts for 95.1% of CPU stacks, requiring full-thread sampling
Willison also used GPT-6 Astra Extra High in Codex to generate flame graphs and heatmaps for the app. The results highlight inefficiencies in line-ending handling, suggesting potential optimizations for the web-edit workflow.
Profiling web-edit with Python 3.15: flame graphs and source heatmaps
Simon Willison · 12 October 2026Loading the full article…
This text was published by Simon Willison and written by Simon Willison. It is reproduced here with attribution so you can read it in full; the rights remain with the publisher. Read it at the source ↗
The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us. Published by Martin K., who runs Digest AI and handles corrections.
More in Research
All →- Meta, Google and NIH invest $1.8B in AI cell simulation project · 1 src
- OpenAI releases 722 math papers from unreleased model · 1 src
- Harvard physicist uses Claude to publish 36 manuscripts in 18 fields in three months · 1 src
- Anthropic research suggests small AI models may self-replicate on IoT devices · 8 src
- DeepMind and Biohub debate AlphaFold’s limits in protein folding · 1 src
Comments
via GitHub Discussions