- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Reduce compile time of rustbuild #92297
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
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    | (rust-highfive has picked a reviewer for you, use r? to override) | 
              
                    jyn514
  
              
              approved these changes
              
                  
                    Dec 27, 2021 
                  
              
              
            
            
| ☔ The latest upstream changes (presumably #92465) made this pull request unmergeable. Please resolve the merge conflicts. | 
Rustbuild already depends on once_cell which in the future can be replaced with std::lazy::Lazy.
The task of the macro is simple enough that a decl macro is almost ten times shorter than the original proc macro. The proc macro is 159 lines while the decl macro is just 18 lines. This reduces the amount of dependencies of rustbuild from 45 to 37. It also slight reduces compilation time from 47s to 44s for debug builds.
This slightly improves compilation time by reducing linking time (saving about a 1/10 of the the total compilation time after changing rustbuild) and slightly reduces disk usage (from 16MB for the rustc wrapper to 4MB).
97f9282    to
    947e948      
    Compare
  
    | Rebased and addressed review comments. | 
| Removed some dead code. | 
| @bors r+ rollup | 
| 📌 Commit 7ea6e71 has been approved by  | 
    
  bors 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      Jan 2, 2022 
    
    
      
  
    
      
    
  
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#84083 (Clarify the guarantees that ThreadId does and doesn't make.) - rust-lang#91593 (Remove unnecessary bounds for some Hash{Map,Set} methods) - rust-lang#92297 (Reduce compile time of rustbuild) - rust-lang#92332 (Add test for where clause order) - rust-lang#92438 (Enforce formatting for rustc_codegen_cranelift) - rust-lang#92463 (Remove pronunciation guide from Vec<T>) - rust-lang#92468 (Emit an error for `--cfg=)`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
    
  github-actions bot
      pushed a commit
        to tautschnig/verify-rust-std
      that referenced
      this pull request
    
      Mar 11, 2025 
    
    
      
  
    
      
    
  
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#84083 (Clarify the guarantees that ThreadId does and doesn't make.) - rust-lang#91593 (Remove unnecessary bounds for some Hash{Map,Set} methods) - rust-lang#92297 (Reduce compile time of rustbuild) - rust-lang#92332 (Add test for where clause order) - rust-lang#92438 (Enforce formatting for rustc_codegen_cranelift) - rust-lang#92463 (Remove pronunciation guide from Vec<T>) - rust-lang#92468 (Emit an error for `--cfg=)`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    S-waiting-on-bors
  Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 
  
    T-bootstrap
  Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 
  
    T-compiler
  Relevant to the compiler team, which will review and decide on the PR/issue. 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Best reviewed commit by commit. The
ignorecrate and it's dependencies are probably responsible for the majority of the compile time after this PR.cc @jyn514 as you got a couple of open rustbuild PR.