Profiling web-edit with Python 3.15Read the article English (automatic translation) |
SummarySimon Willison analyzed his web editing application using the new built-in sampling profilers in Python 3.15 (via GPT-6 Astra Extra High within Codex). The `preserve_endings` function’s mixed line-ending protection dominated the profile, accounting for 64.8% of CPU time across 15,296 stack samples. Additionally, 95.1% of the activity occurred in AnyIO’s worker thread. |
Why it mattersPython 3.15’s native `profiling.sampling` module eliminates the need for third-party tools like py-spy, lowering the barrier to accessing production-quality flame graphs and heatmaps. The finding that nearly all CPU load occurred in a background thread serves as a practical warning: profilers that only monitor the main thread would present a nearly empty picture of a real asynchronous workload. Furthermore, this example illustrates the increasingly common model of AI agents end-to-end executing multi-step engineering tasks such as research, execution, and visualization. |
Highlights
|
Critical takeDespite the 'Research' title, this post is essentially a two-paragraph introduction to a new standard library feature. The actual analytical work was delegated to an AI model rather than performed or at least narrated by Willison. This limits the depth of insight a reader can derive beyond the percentages cited in the headline. |