{
  "description": "Browse aymeric's, an independent, searchable archive of readable snapshots from followed feeds, preserved in Git with aggr.",
  "feed_url": "https://aggr.aymericbeaumet.com/sources/nnethercote.github.io/feed.json",
  "home_page_url": "https://aggr.aymericbeaumet.com/sources/nnethercote.github.io/",
  "items": [
    {
      "authors": [
        {
          "name": "nnethercote.github.io via patchunwrap"
        }
      ],
      "content_html": "<p>My <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://nnethercote.github.io/2026/07/31/how-to-speed-up-the-rust-compiler-in-july-2026.html\">last post</a> on the Rust compiler’s performance was two months ago and a lot has happened since then.</p>\n<h2>Overall progress</h2>\n<p>The measurements for the period 2026-07-29 to 2026-09-28 can be seen <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://perf.rust-lang.org/compare.html?start=1a833e16546c2eb012758ddd499964fd8afee29e&amp;stat=wall-time&amp;tab=compile&amp;end=c1070d69382b8d2f2eb65119c738a77d9e324c9e&amp;nonRelevant=true\">here</a>.</p>\n<p>The mean wall-time reduction was 4.57%, which is a remarkable improvement in just two months. Of the 629 benchmark measurements, 555 of them improved and only 74 regressed. A number of benchmarks saw double-digit percentage reductions. The technical term for this result is “a sea of green”.</p>\n<h2>rustdoc</h2>\n<p>In my last post I mentioned how <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/camelid\">Noah Lev</a> got some enormous speed wins on rustdoc. He recently wrote <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://noahlev.org/blog/2026/08/27/making-rustdoc-faster\">a post</a> explaining in some detail exactly how he did this. It’s an interesting and satisfying read.</p>\n<h2>Clippy</h2>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/159642\">#159642</a>: In this PR <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/Kobzol\">Jakub Beránek</a> enabled PGO for Clippy, giving wall-time improvements across most Clippy benchmarks, in the best case by 18%!</p>\n<h2>LLVM update</h2>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/158734\">#158734</a>: In this PR <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/nikic\">Nikita Popov</a> upgraded the LLVM version used by the compiler to LLVM 23. As often happens when we upgrade LLVM, we saw some nice speedups. The mean wall-time reduction across all benchmarks was 1.2%, which might not sound like much but is really impressive for a single PR. Great work from the LLVM folks!</p>\n<h2>The new borrow checker</h2>\n<p>The new borrow checker, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Polonius\">Polonius</a> <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Alpha\">Alpha</a> (no relation to <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Napoleon_(disambiguation)\">Napoleon</a> <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.youtube.com/watch?v=gdZLi9oWNZg\">Dynamite</a>), was <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://blog.rust-lang.org/2026/08/04/enabling-polonius-alpha-on-nightly/\">enabled on Nightly</a>. It is more precise than the existing borrow checker and accepts some valid programs that the old borrow checker would reject. It does do more work than the old borrow checker, enough to make a measurable difference to compile time in a minority of cases, including the popular <code>serde</code> crate. Fortunately, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/jackh726\">Jack Huey</a> has been on the case.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/161938\">#161938</a>: In this PR Jack made some liveness computations lazy, which reduced instruction counts for <code>serde</code> by 3-5%, and for some other benchmarks by less than 1%.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/163027\">#163027</a>: In this PR Jack adjusted a data structure and tweaked some inlining, for mostly sub-1% instruction count reductions across numerous benchmarks.</p>\n<p>There is more work to be done to reduce the remaining Polonius Alpha regressions, but it’s worth noting that the “sea of green” shows these regressions were swamped by the many other recent improvements.</p>\n<h2>The new trait solver</h2>\n<p>The new trait solver, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Anne_Hathaway\">Penelope</a> <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.youtube.com/watch?v=q8WSdypJ4WA\">Hammertime</a>, <em>[Ed. note: is that right?]</em> was also <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://blog.rust-lang.org/2026/08/21/enabling-next-solver-on-nightly/\">enabled on Nightly</a>.</p>\n<p>As I said, a lot has been happening.</p>\n<p>Like the new borrow checker, the new trait solver is slower in a minority of cases. <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/jdonszelmann\">Jana Dönszelmann</a> wrote a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://donsz.nl/blog/new-solver-performance\">detailed post</a> about the efforts to improve the performance of this new solver.</p>\n<p>Jana’s post is detailed enough that I won’t say much more about the large amount of ongoing work on the new solver, but I will mention in passing the PRs I made: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160479\">#160479</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160605\">#160605</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160801\">#160801</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160892\">#160892</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/161077\">#161077</a>, and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/161211\">#161211</a>. Some of these reduced compile times greatly for certain outlier crates: 50% here, 25% there, 15% there, and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/issues/159933#issuecomment-5333109889\">even more</a> on one stress test. And I am not the only one who has made progress here… go read Jana’s post.</p>\n<h2>xmakro</h2>\n<p>New contributor <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/xmakro\">xmakro</a> continued their run of good improvements.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/157281\">#157281</a>: In this PR xmakro optimized impl handling when building the specialization graph. This gave a mean cycle count reduction of 1.58% across all benchmarks, which is huge for a single PR.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/158059\">#158059</a>: In this PR xmakro optimized one aspect of the loading of incremental compilation data, reducing instruction counts across multiple benchmarks, in the best case by 6%.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160473\">#160473</a>: In this PR xmakro avoided some allocations in a hot obligations processing path, reducing instruction counts across numerous benchmarks, in the best case by 2%.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160268\">#160268</a>: In this PR xmakro avoided a lot of allocations by changing the old/new trait solver selection code to use static dispatch instead of dynamic dispatch. This gave mostly sub-1% instruction count reductions across a number of benchmarks. This hot allocation path had been showing up in profiles for a while and I had earlier tried exactly the same idea in <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/155714\">#155714</a>. But I got regressions on a couple of benchmarks, possibly due to slightly different choices of where to place some <code>#[inline]</code> attributes. It was good to see this obvious inefficiency fixed.</p>\n<h2>Dataflow analysis</h2>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160193\">#160193</a>: In this PR I changed the CFG traversal algorithm used by the dataflow analyses in the compiler. These analyses iterate to a fixpoint and the traversal algorithm can affect how quickly the fixpoint is reached. For most code the new algorithm makes no difference, but the <code>cranelift-codegen</code> crate has one enormous function with over 18,000 basic blocks. The old algorithm required 1.5 million calls to <code>apply_effects_in_block</code> to reach a fixpoint for the <code>EverInitializedPlaces</code> analysis used by the borrow checker; the new algorithm requires 90,000. This gave an enormous ~30% wall-time reduction for a <code>check</code> build of this crate.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160033\">#160033</a>: In this PR I made <code>EverInitializedPlaces</code> more efficient again, this time by not tracking unnecessary data for projections. This reduced instruction counts on the <code>match-stress</code> benchmark by 17%, and on a few other benchmarks by less than 1%.</p>\n<h2>LLMs</h2>\n<p>They’ve gotten very good at certain kinds of analysis. I’m still writing all my own code and text, because (a) that’s paramount, and (b) the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://forge.rust-lang.org/policies/llm-usage.html\">project policy</a> requires it, but I had useful LLM analysis assistance on several of the PRs mentioned in this post.</p>\n<p>Anyway, enough about that.</p>\n<h2>Miscellaneous</h2>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160535\">#160535</a>: In this PR <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/ChrisDenton\">Chris Denton</a> increased the default stack size used by the compiler, which allowed the removal of <code>ensure_sufficient_stack</code>, a manual stack extension mechanism sprinkled about in places prone to high levels of recursion. There was a lot of discussion about this one because it can be difficult to decide how to best deal with stack exhaustion. But the performance effects are clear, with reduced instruction counts across many benchmarks, in the best case by almost 3%.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/160506\">#160506</a>: The project uses a lot of “rollup” PRs, where multiple PRs are merged together. This is because we don’t have sufficient CI capacity to merge every PR individually. Normally PRs that affect performance are merged by themselves so we can measure their effects clearly. For the first time ever, at one point we had so many performance improvement PRs waiting in the merge queue that <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/JonathanBrouwer\">Jonathan Brouwer</a> created a rollup containing 10 performance-improving PRs to keep things moving! This is a good problem to have. And later on we had <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/162859\">#162859</a> which contained four performance-improving PRs. (You needn’t worry about unexpected effects slipping in because we have the ability to run the perf benchmark suite on the individual PRs after merging, to make sure each PR had the expected performance effect.)</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/rust-lang/rust/pull/162747\">#162747</a>: In this PR I made some minor improvements to the code that lowers AST to HIR. It was a cleanup that wasn’t expected to affect performance but it reduced instruction counts across numerous benchmarks, in the best case by 1.5%. Sometimes you get lucky.</p>\n<h2>Job status</h2>\n<p>Tomorrow I will start working at <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://hexcat.nl/\">Hexcat</a> on the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://goals.rust-lang.org/2026/compiler-performance-optimization.html\">compiler performance optimizations</a> project goal. It’s exciting! Many thanks to Mara Bos, Predrag Gruevski, and all the other people who helped make this happen.</p>\n<h3><em>Editor’s postscript</em></h3>\n<p>The new solver’s name is not <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Penelope,_Texas\">Penelope</a> <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.youtube.com/watch?v=OJWJE0x7T4Q\">Hammer</a><br />\n<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.youtube.com/watch?v=Qr0-7Ds79zo\">time</a>; that was a joke.</p>\n<h4>Author’s postscript</h4>\n<p>Its real name is <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Australian_fifty-dollar_note\">Pineapple</a> <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/Ben_&amp;_Jerry&#x27;s\">Häagen-Dazs</a>.</p>\n",
      "date_modified": "2026-09-30T02:08:22+00:00",
      "date_published": "2026-09-30T02:08:22+00:00",
      "external_url": "https://nnethercote.github.io/2026/09/30/how-to-speed-up-the-rust-compiler-in-september-2026.html",
      "id": "urn:aggr:item:d76821c138046940cdb305868fdb1b0b5279d504",
      "summary": "Comments",
      "tags": [
        "news",
        "compilers",
        "rust",
        "vibecoding"
      ],
      "title": "How to speed up the Rust compiler in September 2026",
      "url": "https://aggr.aymericbeaumet.com/items/lobste-rs/2026-09-30-how-to-speed-up-the-rust-compiler-in-september-2026/"
    }
  ],
  "language": "en",
  "title": "nnethercote.github.io",
  "version": "https://jsonfeed.org/version/1.1"
}