oxidecomputer / oxidecomputer/third-party-api-clients
compilation is awfully slow
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 150
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
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:
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with cargo build --timings -p octorust --no-default-features, then compare it with the default-feature build. Review the cargo +nightly rustc -- -Z self-profile output using summarize and investigate the reported LLVM code generation, type checking, and borrow-checking time. Done should identify the source of the slow compilation and document or implement a justified improvement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100