Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation is awfully slow #103

Open
tamird opened this issue Mar 15, 2025 · 0 comments
Open

compilation is awfully slow #103

tamird opened this issue Mar 15, 2025 · 0 comments

Comments

@tamird
Copy link

tamird commented Mar 15, 2025

Hello! On my M3 Pro it takes 22 seconds to compile octorust (excluding dependencies). This timing seems insensitive to features (same result with default and --no-default-features).

I can't attach the HTML report generated by cargo build --timings -p octorust --no-default-features but here's a snippet:

Image

I tried profiling the compiler:

cargo install --git https://github.com/rust-lang/measureme summarize
cd github
cargo +nightly rustc -- -Z self-profile
summarize summarize ../octorust-*.mm_profdata | head -n11
+-------------------------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| Item                                                                    | Self time | % of total time | Time     | Item count | Incremental result hashing time |
+-------------------------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| LLVM_module_codegen_emit_obj                                            | 6.43s     | 19.772          | 6.43s    | 186        | 0.00ns                          |
+-------------------------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| typeck                                                                  | 4.77s     | 14.649          | 5.29s    | 30934      | 387.19ms                        |
+-------------------------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| mir_borrowck                                                            | 3.01s     | 9.260           | 5.76s    | 30934      | 3.85ms                          |
+-------------------------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| LLVM_passes                                                             | 1.59s     | 4.880           | 1.59s    | 1          | 0.00ns                          |
+-------------------------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+

I don't find this particularly telling, but it's a start. Is it possible there's a lot of duplication in the generated code? I haven't looked deeply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant