{"id":1238289,"date":"2025-03-10T10:56:13","date_gmt":"2025-03-10T14:56:13","guid":{"rendered":"https:\/\/www.prime-wow.com\/?p=1238289"},"modified":"2025-03-10T10:56:13","modified_gmt":"2025-03-10T14:56:13","slug":"python-tail-call-speedup-based-on-llvm-regression","status":"publish","type":"post","link":"https:\/\/www.prime-wow.com\/?p=1238289","title":{"rendered":"Python tail-call speedup based on LLVM regression"},"content":{"rendered":"<div>\n<p>\nThe <a href=\"https:\/\/lwn.net\/Articles\/1010905\/\">Python project&#8217;s recent switch to a tail-calling interpreter<\/a> may not provide as large a speed advantage as initially thought. A <a href=\"https:\/\/blog.nelhage.com\/post\/cpython-tail-call\/\">blog post<\/a> from Nelson Elhage gives the details. In short, switching to a tail-call-based interpreter accidentally works around an unfixed regression in LLVM 19. On other compilers, the performance benefit (while still present) is more moderate.\n<\/p>\n<blockquote class=\"bq\"><p>\nWhen the tail-call interpreter was announced, I was surprised and impressed by the performance improvements, but also confused: I&#8217;m not an expert, but I&#8217;m passingly-familiar with modern CPU hardware, compilers, and interpreter design, and I couldn&#8217;t explain why this change would be so effective. I became curious \u2013 and perhaps slightly obsessed \u2013 and the reports in this post are the result of a few weeks of off-and-on compiling and benchmarking and disassembly of dozens of different Python binaries, in an attempt to understand what I was seeing.\n<\/p><\/blockquote>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Python project&#8217;s recent switch to a tail-calling interpreter may not provide as large a speed advantage as initially thought. A blog post from Nelson Elhage gives the details. In short, switching to a tail-call-based interpreter accidentally works around an &hellip; <a href=\"https:\/\/www.prime-wow.com\/?p=1238289\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[72,116,110],"tags":[],"class_list":["post-1238289","post","type-post","status-publish","format-standard","hentry","category-linux","category-lwn-net","category-unfiltered-rss"],"_links":{"self":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts\/1238289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1238289"}],"version-history":[{"count":0,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts\/1238289\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1238289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1238289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1238289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}