{"version":1,"type":"story","url":"https://digestai.news/story/python-3-15s-profiler-finds-line-ending-code-dominates-web-edit-app","json":"https://digestai.news/story/python-3-15s-profiler-finds-line-ending-code-dominates-web-edit-app.json","markdown":"https://digestai.news/story/python-3-15s-profiler-finds-line-ending-code-dominates-web-edit-app.md","slug":"python-3-15s-profiler-finds-line-ending-code-dominates-web-edit-app","headline":"Python 3.15’s profiler finds line-ending code dominates web-edit app","summary":"Simon Willison profiled a Python 3.15 web-edit app using built-in sampling tools. The app’s `preserve_endings` feature consumed 64.8% of CPU time across 15,296 recorded stacks, with `SequenceMatcher.find_longest_match` 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 thread.\n\nWillison 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.","keyPoints":["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"],"whyItMatters":"Identifying performance bottlenecks like line-ending handling helps developers optimize Python apps, reducing unnecessary CPU load in editing workflows.","category":{"slug":"research","name":"Research","url":"https://digestai.news/category/research"},"entities":{"companies":[],"models":["GPT-6 Astra Extra High","Codex"],"people":["Simon Willison"]},"firstPublishedAt":"2026-10-12T16:58:00Z","updatedAt":"2026-10-12T16:58:00Z","sourceCount":1,"hasPrimarySource":false,"sources":[{"outlet":"Simon Willison","title":"Profiling web-edit with Python 3.15: flame graphs and source heatmaps","url":"https://simonwillison.net/2026/Oct/12/python-3-15-web-edit-profiling","publishedAt":"2026-10-12T16:58:00Z","type":"newsletter","primary":false,"lead":true}],"sourceNotes":null,"discussions":[],"thread":null,"cite":{"text":"Digest AI, \"Python 3.15’s profiler finds line-ending code dominates web-edit app\", 12 October 2026, https://digestai.news/story/python-3-15s-profiler-finds-line-ending-code-dominates-web-edit-app","publisher":"Digest AI","title":"Python 3.15’s profiler finds line-ending code dominates web-edit app","datePublished":"2026-10-12T16:58:00Z","url":"https://digestai.news/story/python-3-15s-profiler-finds-line-ending-code-dominates-web-edit-app"},"generatedBy":"Written by Digest AI's editorial model from the linked sources; the sources are the record.","license":"Headlines, digests and key points are written by Digest AI and may be quoted with a link to the story page. Linked articles belong to their publishers. Terms: https://digestai.news/terms#reuse"}