Slow compilation of actix-web routes #140944
Labels
C-bug
Category: This is a bug.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
I-compiletime
Issue: Problems and improvements with respect to compile times.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I noticed that Rust is extremely slow to compile a rather simple file containing route definitions for the actix-web webserver. It has 200 lines of imports, 250 lines of code and no macros, yet takes ~60s to compile. Duration is the same on Rust 1.81, 1.86 and nightly-2025-04-27.
Here is an excerpt from the profiling data, and you can also view the .mm_profdata.
Whats strange is that the same file on the main branch takes only ~25s to compile (which is still too long). There it is part of the main binary crate.
To reproduce run:
git clone https://github.com/LemmyNet/lemmy.git --recursive --branch api-routes-crate cd lemmy cargo build --timings -p lemmy_api_routes
The text was updated successfully, but these errors were encountered: