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

Consider using incremental linking with msvc #37543

Open
retep998 opened this issue Nov 2, 2016 · 26 comments
Open

Consider using incremental linking with msvc #37543

retep998 opened this issue Nov 2, 2016 · 26 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@retep998
Copy link
Member

retep998 commented Nov 2, 2016

Incremental linking will allow for significantly faster link times, at the cost of binary size.

  1. Don't delete the output artifacts. The .ilk and .exe or .dll must remain from the previous run.
  2. Don't pass /OPT to the linker or any other flag that is mutually exclusive with incremental linking.
  3. Pass /INCREMENTAL to the linker.
  4. The set of files passed to the linker must remain the same. If the codegen unit object files change names, then it will do a full link.

https://msdn.microsoft.com/en-us/library/4khtbfyf.aspx

Alternatively, provide LLD as a stable alternative to link.exe so users can benefit from faster links when they don't need any special features of link.exe.

@GuillaumeGomez GuillaumeGomez added O-windows-msvc Toolchain: MSVC, Operating system: Windows A-incr-comp Area: Incremental compilation labels Nov 2, 2016
@brupelo
Copy link

brupelo commented Nov 3, 2016

This issue has been opened because the building times with rust-qt are quite high. Here's a simple example:

Specs

cpu: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60 Ghz,  cores=4,  threads=8

rustc 1.12.1 (d4f39402a 2016-10-19)
binary: rustc
commit-hash: d4f39402a0c2c2b94ec0375cd7f7f6d7918113cd
commit-date: 2016-10-19
host: x86_64-pc-windows-msvc
release: 1.12.1

Cargo.toml

   [dependencies]
   qt_core = "*"
   qt_gui = "*"
   qt_widgets = "*"

Debug mode

cargo rustc -- -Z time-passes > log_debug.txt 2>&1

The backlog is:

warning: the option `Z` is unstable and should only be used on the nightly compiler, but it is currently accepted for backwards compatibility; this will soon change, see issue #31847 for more details

time: 0.000; rss: 15MB  parsing
time: 0.000; rss: 16MB  configuration
time: 0.000; rss: 16MB  recursion limit
time: 0.000; rss: 16MB  crate injection
time: 0.000; rss: 16MB  plugin loading
time: 0.000; rss: 16MB  plugin registration
time: 0.034; rss: 48MB  expansion
time: 0.000; rss: 48MB  maybe building test harness
time: 0.000; rss: 49MB  assigning node ids
time: 0.000; rss: 49MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 49MB  complete gated feature checking
time: 0.000; rss: 49MB  collecting defs
time: 0.003; rss: 49MB  external crate/lib resolution
time: 0.000; rss: 49MB  early lint checks
time: 0.000; rss: 49MB  AST validation
time: 0.000; rss: 49MB  name resolution
time: 0.000; rss: 50MB  lowering ast -> hir
time: 0.000; rss: 50MB  indexing hir
time: 0.000; rss: 50MB  attribute checking
time: 0.000; rss: 50MB  language item collection
time: 0.000; rss: 50MB  lifetime resolution
time: 0.000; rss: 50MB  looking for entry point
time: 0.000; rss: 50MB  looking for plugin registrar
time: 0.000; rss: 50MB  region resolution
time: 0.000; rss: 50MB  loop checking
time: 0.000; rss: 50MB  static item recursion checking
time: 0.000; rss: 50MB  load_dep_graph
time: 0.000; rss: 50MB  type collecting
time: 0.000; rss: 50MB  variance inference
time: 0.006; rss: 51MB  coherence checking
time: 0.000; rss: 52MB  wf checking
time: 0.000; rss: 52MB  item-types checking
time: 0.000; rss: 53MB  item-bodies checking
time: 0.000; rss: 53MB  drop-impl checking
time: 0.000; rss: 53MB  const checking
time: 0.000; rss: 53MB  privacy checking
time: 0.000; rss: 53MB  stability index
time: 0.000; rss: 53MB  intrinsic checking
time: 0.000; rss: 53MB  effect checking
time: 0.000; rss: 53MB  match checking
time: 0.000; rss: 53MB  liveness checking
time: 0.000; rss: 53MB  rvalue checking
time: 0.000; rss: 54MB  MIR dump
time: 0.001; rss: 54MB  MIR passes
time: 0.000; rss: 54MB  borrow checking
time: 0.000; rss: 54MB  reachability checking
time: 0.000; rss: 54MB  death checking
time: 0.000; rss: 54MB  stability checking
time: 0.000; rss: 54MB  unused lib feature checking
time: 0.000; rss: 54MB  lint checking
time: 0.002; rss: 54MB  resolving dependency formats
time: 0.000; rss: 54MB  Prepare MIR codegen passes
  time: 0.000; rss: 55MB    write metadata
  time: 0.001; rss: 55MB    translation item collection
  time: 0.000; rss: 55MB    codegen unit partitioning
  time: 0.000; rss: 58MB    internalize symbols
time: 0.011; rss: 58MB  translation
time: 0.000; rss: 58MB  assert dep graph
time: 0.000; rss: 58MB  serialize dep graph
  time: 0.000; rss: 58MB    llvm function passes [0]
  time: 0.000; rss: 58MB    llvm module passes [0]
  time: 0.002; rss: 60MB    codegen passes [0]
  time: 0.000; rss: 60MB    codegen passes [0]
time: 0.004; rss: 60MB  LLVM passes
time: 0.000; rss: 60MB  serialize work products
  time: 0.149; rss: 60MB    running linker
time: 0.151; rss: 60MB  linking
    Finished debug [unoptimized + debuginfo] target(s) in 4202.78 secs

Release mode

cargo rustc --release -- -Z time-passes > log_release.txt 2>&1

The backlog is:

warning: the option `Z` is unstable and should only be used on the nightly compiler, but it is currently accepted for backwards compatibility; this will soon change, see issue #31847 for more details

time: 0.000; rss: 15MB  parsing
time: 0.000; rss: 16MB  configuration
time: 0.000; rss: 16MB  recursion limit
time: 0.000; rss: 16MB  crate injection
time: 0.000; rss: 16MB  plugin loading
time: 0.000; rss: 16MB  plugin registration
time: 0.039; rss: 48MB  expansion
time: 0.000; rss: 48MB  maybe building test harness
time: 0.000; rss: 49MB  assigning node ids
time: 0.000; rss: 49MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 49MB  complete gated feature checking
time: 0.000; rss: 49MB  collecting defs
time: 0.003; rss: 49MB  external crate/lib resolution
time: 0.000; rss: 49MB  early lint checks
time: 0.000; rss: 49MB  AST validation
time: 0.000; rss: 49MB  name resolution
time: 0.000; rss: 50MB  lowering ast -> hir
time: 0.000; rss: 50MB  indexing hir
time: 0.000; rss: 50MB  attribute checking
time: 0.000; rss: 50MB  language item collection
time: 0.000; rss: 50MB  lifetime resolution
time: 0.000; rss: 50MB  looking for entry point
time: 0.000; rss: 50MB  looking for plugin registrar
time: 0.000; rss: 50MB  region resolution
time: 0.000; rss: 50MB  loop checking
time: 0.000; rss: 50MB  static item recursion checking
time: 0.000; rss: 50MB  load_dep_graph
time: 0.000; rss: 50MB  type collecting
time: 0.000; rss: 50MB  variance inference
time: 0.006; rss: 51MB  coherence checking
time: 0.000; rss: 52MB  wf checking
time: 0.000; rss: 52MB  item-types checking
time: 0.001; rss: 53MB  item-bodies checking
time: 0.000; rss: 53MB  drop-impl checking
time: 0.000; rss: 53MB  const checking
time: 0.000; rss: 53MB  privacy checking
time: 0.000; rss: 53MB  stability index
time: 0.000; rss: 53MB  intrinsic checking
time: 0.000; rss: 53MB  effect checking
time: 0.000; rss: 53MB  match checking
time: 0.000; rss: 53MB  liveness checking
time: 0.000; rss: 53MB  rvalue checking
time: 0.000; rss: 54MB  MIR dump
time: 0.001; rss: 54MB  MIR passes
time: 0.000; rss: 54MB  borrow checking
time: 0.000; rss: 54MB  reachability checking
time: 0.000; rss: 54MB  death checking
time: 0.000; rss: 54MB  stability checking
time: 0.000; rss: 54MB  unused lib feature checking
time: 0.000; rss: 54MB  lint checking
time: 0.002; rss: 54MB  resolving dependency formats
time: 0.000; rss: 54MB  Prepare MIR codegen passes
  time: 0.000; rss: 55MB  write metadata
  time: 0.001; rss: 55MB  translation item collection
  time: 0.000; rss: 55MB  codegen unit partitioning
  time: 0.000; rss: 57MB  internalize symbols
time: 0.011; rss: 57MB  translation
time: 0.000; rss: 57MB  assert dep graph
time: 0.000; rss: 57MB  serialize dep graph
  time: 0.001; rss: 58MB  llvm function passes [0]
  time: 0.002; rss: 59MB  llvm module passes [0]
  time: 0.003; rss: 62MB  codegen passes [0]
  time: 0.001; rss: 62MB  codegen passes [0]
time: 0.009; rss: 62MB  LLVM passes
time: 0.000; rss: 62MB  serialize work products
  time: 0.161; rss: 62MB  running linker
time: 0.162; rss: 62MB  linking
    Finished release [optimized] target(s) in 1865.86 secs

@brupelo
Copy link

brupelo commented Nov 3, 2016

But the main problem is not the crazy times when doing a cold build on the qt crates but the crazy times it takes to build the simplest qt example, for instance, let's consider this dummy example:

extern crate qt_widgets;

use qt_widgets::application::Application;
use qt_widgets::push_button::PushButton;
use qt_widgets::cpp_utils::*;
use qt_widgets::qt_core::string::String;
use qt_widgets::libc::{c_char, c_int};

fn to_qt_string<S: AsRef<str>>(s: S) -> String {
  let slice = s.as_ref().as_bytes();
  String::from_utf8((slice.as_ptr() as *const c_char, slice.len() as c_int, AsStruct))
}

fn from_qt_string(string: &String) -> std::string::String {
  let buf = string.to_utf8(AsStruct);
  unsafe {
    let bytes = std::slice::from_raw_parts(buf.const_data() as *const u8, buf.count(()) as usize);
    std::str::from_utf8_unchecked(bytes).to_string()
  }
}

fn main() {
  let _app = Application::new((&mut 0i32, &mut (&mut 0i8 as *mut i8) as *mut *mut i8, AsBox));
  let mut btn = PushButton::new((&to_qt_string("first_button"), AsBox));
  let mut btn2 = PushButton::new((&to_qt_string("second_button"), AsBox));
  let text = from_qt_string(&btn.text(AsStruct));
  let text2 = from_qt_string(&btn2.text(AsStruct));
  btn.show();
  btn2.show();
  let ret = Application::exec();
}

If i build and then touch this file (no editing at all, just saving/changing timestamp) and I run cargo rustc -- -Z time-passes the backlog will be:

   Compiling qt_workspace v0.1.0 (file:///D:/sources/personal/rust/qt_workspace)
warning: the option `Z` is unstable and should only be used on the nightly compiler, but it is currently accepted for backwards compatibility; this will soon change, see issue #31847 for more details

time: 0.001; rss: 16MB  parsing
time: 0.000; rss: 16MB  configuration
time: 0.000; rss: 16MB  recursion limit
time: 0.000; rss: 16MB  crate injection
time: 0.000; rss: 16MB  plugin loading
time: 0.000; rss: 16MB  plugin registration
time: 0.034; rss: 48MB  expansion
time: 0.000; rss: 48MB  maybe building test harness
time: 0.000; rss: 48MB  assigning node ids
time: 0.000; rss: 48MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 48MB  complete gated feature checking
time: 0.000; rss: 48MB  collecting defs
time: 0.234; rss: 217MB external crate/lib resolution
time: 0.000; rss: 217MB early lint checks
time: 0.000; rss: 217MB AST validation
time: 0.002; rss: 219MB name resolution
time: 0.000; rss: 220MB lowering ast -> hir
time: 0.000; rss: 220MB indexing hir
time: 0.000; rss: 220MB attribute checking
time: 0.000; rss: 220MB language item collection
time: 0.000; rss: 220MB lifetime resolution
time: 0.000; rss: 220MB looking for entry point
time: 0.000; rss: 220MB looking for plugin registrar
time: 0.000; rss: 220MB region resolution
time: 0.000; rss: 220MB loop checking
time: 0.000; rss: 220MB static item recursion checking
time: 0.000; rss: 220MB load_dep_graph
time: 0.001; rss: 221MB type collecting
time: 0.000; rss: 221MB variance inference
time: 0.020; rss: 224MB coherence checking
time: 0.002; rss: 225MB wf checking
time: 0.000; rss: 225MB item-types checking
time: 0.025; rss: 229MB item-bodies checking
time: 0.000; rss: 229MB drop-impl checking
time: 0.001; rss: 229MB const checking
time: 0.000; rss: 229MB privacy checking
time: 0.000; rss: 229MB stability index
time: 0.000; rss: 229MB intrinsic checking
time: 0.000; rss: 229MB effect checking
time: 0.000; rss: 229MB match checking
time: 0.000; rss: 229MB liveness checking
time: 0.000; rss: 229MB rvalue checking
time: 0.001; rss: 230MB MIR dump
time: 0.000; rss: 230MB MIR passes
time: 0.000; rss: 231MB borrow checking
time: 0.000; rss: 231MB reachability checking
time: 0.000; rss: 231MB death checking
time: 0.000; rss: 231MB stability checking
time: 0.000; rss: 231MB unused lib feature checking
warning: unused variable: `text`, #[warn(unused_variables)] on by default
  --> main.rs:26:7
   |
26 |   let text = from_qt_string(&btn.text(AsStruct));
   |       ^^^^

warning: unused variable: `text2`, #[warn(unused_variables)] on by default
  --> main.rs:27:7
   |
27 |   let text2 = from_qt_string(&btn2.text(AsStruct));
   |       ^^^^^

warning: unused variable: `ret`, #[warn(unused_variables)] on by default
  --> main.rs:30:7
   |
30 |   let ret = Application::exec();
   |       ^^^

time: 0.006; rss: 231MB lint checking
time: 0.002; rss: 231MB resolving dependency formats
time: 0.001; rss: 231MB Prepare MIR codegen passes
  time: 0.000; rss: 231MB       write metadata
  time: 0.026; rss: 239MB       translation item collection
  time: 0.000; rss: 239MB       codegen unit partitioning
  time: 0.001; rss: 244MB       internalize symbols
time: 0.164; rss: 244MB translation
time: 0.000; rss: 244MB assert dep graph
time: 0.000; rss: 244MB serialize dep graph
  time: 0.001; rss: 239MB       llvm function passes [0]
  time: 0.000; rss: 239MB       llvm module passes [0]
  time: 0.018; rss: 242MB       codegen passes [0]
  time: 0.000; rss: 242MB       codegen passes [0]
time: 0.021; rss: 242MB LLVM passes
time: 0.000; rss: 242MB serialize work products
  time: 34.444; rss: 242MB      running linker
time: 34.446; rss: 242MB        linking
    Finished debug [unoptimized + debuginfo] target(s) in 35.5 secs

If i do the same process for release > cargo rustc --release -- -Z time-passes the backlog will be:

   Compiling qt_workspace v0.1.0 (file:///D:/sources/personal/rust/qt_workspace)
warning: the option `Z` is unstable and should only be used on the nightly compiler, but it is currently accepted for backwards compatibility; this will soon change, see issue #31847 for more details

time: 0.000; rss: 16MB  parsing
time: 0.000; rss: 16MB  configuration
time: 0.000; rss: 16MB  recursion limit
time: 0.000; rss: 16MB  crate injection
time: 0.000; rss: 16MB  plugin loading
time: 0.000; rss: 16MB  plugin registration
time: 0.040; rss: 48MB  expansion
time: 0.000; rss: 48MB  maybe building test harness
time: 0.000; rss: 48MB  assigning node ids
time: 0.000; rss: 48MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 48MB  complete gated feature checking
time: 0.000; rss: 48MB  collecting defs
time: 0.241; rss: 217MB external crate/lib resolution
time: 0.000; rss: 217MB early lint checks
time: 0.000; rss: 217MB AST validation
time: 0.002; rss: 219MB name resolution
time: 0.000; rss: 219MB lowering ast -> hir
time: 0.000; rss: 220MB indexing hir
time: 0.000; rss: 220MB attribute checking
time: 0.000; rss: 220MB language item collection
time: 0.000; rss: 220MB lifetime resolution
time: 0.000; rss: 220MB looking for entry point
time: 0.000; rss: 220MB looking for plugin registrar
time: 0.000; rss: 220MB region resolution
time: 0.000; rss: 220MB loop checking
time: 0.000; rss: 220MB static item recursion checking
time: 0.000; rss: 220MB load_dep_graph
time: 0.001; rss: 220MB type collecting
time: 0.000; rss: 221MB variance inference
time: 0.021; rss: 224MB coherence checking
time: 0.002; rss: 224MB wf checking
time: 0.000; rss: 224MB item-types checking
time: 0.026; rss: 229MB item-bodies checking
time: 0.000; rss: 229MB drop-impl checking
time: 0.000; rss: 229MB const checking
time: 0.000; rss: 229MB privacy checking
time: 0.000; rss: 229MB stability index
time: 0.000; rss: 229MB intrinsic checking
time: 0.000; rss: 229MB effect checking
time: 0.000; rss: 229MB match checking
time: 0.000; rss: 229MB liveness checking
time: 0.000; rss: 229MB rvalue checking
time: 0.001; rss: 230MB MIR dump
time: 0.000; rss: 230MB MIR passes
time: 0.000; rss: 231MB borrow checking
time: 0.000; rss: 231MB reachability checking
time: 0.000; rss: 231MB death checking
time: 0.000; rss: 231MB stability checking
time: 0.000; rss: 231MB unused lib feature checking
warning: unused variable: `text`, #[warn(unused_variables)] on by default
  --> main.rs:26:7
   |
26 |   let text = from_qt_string(&btn.text(AsStruct));
   |       ^^^^

warning: unused variable: `text2`, #[warn(unused_variables)] on by default
  --> main.rs:27:7
   |
27 |   let text2 = from_qt_string(&btn2.text(AsStruct));
   |       ^^^^^

warning: unused variable: `ret`, #[warn(unused_variables)] on by default
  --> main.rs:30:7
   |
30 |   let ret = Application::exec();
   |       ^^^

time: 0.006; rss: 231MB lint checking
time: 0.003; rss: 231MB resolving dependency formats
time: 0.001; rss: 231MB Prepare MIR codegen passes
  time: 0.000; rss: 231MB       write metadata
  time: 0.026; rss: 239MB       translation item collection
  time: 0.000; rss: 239MB       codegen unit partitioning
  time: 0.001; rss: 245MB       internalize symbols
time: 0.160; rss: 245MB translation
time: 0.000; rss: 245MB assert dep graph
time: 0.000; rss: 245MB serialize dep graph
  time: 0.002; rss: 239MB       llvm function passes [0]
  time: 0.019; rss: 241MB       llvm module passes [0]
  time: 0.010; rss: 243MB       codegen passes [0]
  time: 0.001; rss: 243MB       codegen passes [0]
time: 0.034; rss: 243MB LLVM passes
time: 0.000; rss: 243MB serialize work products
  time: 35.683; rss: 244MB      running linker
time: 35.685; rss: 244MB        linking
    Finished release [optimized] target(s) in 36.32 secs

And that's the main problem, you can't iterate with these crazy times for a trivial example. Hopefully all this info will help to improve rust. Amazing package manager, cool language syntax and features... but... if building times are that crazy I don't see which benefits would bring me to stay away from c++/qt or python/pyqt.

Regards.

@alexcrichton alexcrichton removed the A-incr-comp Area: Incremental compilation label Nov 3, 2016
@michaelwoerister
Copy link
Member

I always envisioned that we would use any incremental linking functionality available when also compiling incrementally. That is certainly a good idea. Always using it also for regular builds is probably not a good idea because of binary sizes.

Show we expose incremental linking as a separate -C flag? Cargo.toml could have an incremental profile key that could be set to link-only?

The Gold linker also allows for incremental linking.

cc @rust-lang/tools @rust-lang/compiler

@alexcrichton
Copy link
Member

Seems plausible to me, I'd be fine just defaulting to using this with -C incremental=foo once that's stabilized.

@jasonwilliams
Copy link
Member

jasonwilliams commented Mar 19, 2018

hey @alexcrichton Whats the update on this?
Servo takes an awful long time to compile on Windows and i think its related to the lack of this.
Is there anything i can do to push this forward?

@alexcrichton
Copy link
Member

Not much has happened on this AFAIK, but we can still implement it at any time!

@Boscop
Copy link

Boscop commented Mar 20, 2018

FWIW, here is the log of one of my normal Rust projects that's not using Qt or any huge lib, also after just touching a file.

cargo rustc -- -Z time-passes
> cargo rustc -- -Z time-passes
  time: 0.140; rss: 24MB      parsing
  time: 0.000; rss: 24MB      garbage collect incremental cache directory
  time: 0.000; rss: 24MB      recursion limit
  time: 0.000; rss: 24MB      crate injection
  time: 0.000; rss: 24MB      plugin loading
  time: 0.000; rss: 24MB      background load prev dep-graph
  time: 0.000; rss: 24MB      plugin registration
  time: 12.414; rss: 145MB    expansion
  time: 0.000; rss: 145MB     maybe building test harness
  time: 0.003; rss: 145MB     maybe creating a macro crate
  time: 0.008; rss: 145MB     creating allocators
  time: 0.007; rss: 145MB     AST validation
  time: 0.074; rss: 164MB     name resolution
  time: 0.007; rss: 164MB     complete gated feature checking
  time: 0.000; rss: 164MB     blocked while dep-graph loading finishes
  time: 0.037; rss: 175MB     lowering ast -> hir
  time: 0.016; rss: 175MB     early lint checks
  time: 0.045; rss: 174MB     indexing hir
  time: 0.000; rss: 171MB     load query result cache
  time: 0.000; rss: 171MB     looking for entry point
  time: 0.000; rss: 171MB     looking for plugin registrar
  time: 0.003; rss: 171MB     loop checking
  time: 0.027; rss: 190MB     attribute checking
  time: 0.020; rss: 191MB     stability checking
  time: 0.102; rss: 215MB     type collecting
  time: 0.000; rss: 215MB     outlives testing
  time: 0.002; rss: 215MB     impl wf inference
  time: 0.400; rss: 308MB     coherence checking
  time: 0.000; rss: 308MB     variance testing
  time: 0.205; rss: 324MB     wf checking
  time: 0.050; rss: 325MB     item-types checking
  time: 1.493; rss: 355MB     item-bodies checking
  time: 0.167; rss: 382MB     const checking
  time: 0.053; rss: 382MB     privacy checking
  time: 0.004; rss: 382MB     intrinsic checking
  time: 0.026; rss: 383MB     match checking
  time: 0.609; rss: 412MB     borrow checking
  time: 6.990; rss: 423MB     MIR borrow checking
  time: 0.001; rss: 423MB     MIR effect checking
  time: 0.025; rss: 423MB     death checking
  time: 0.000; rss: 423MB     unused lib feature checking
  time: 0.070; rss: 423MB     lint checking
  time: 0.002; rss: 423MB     resolving dependency formats
  time: 0.000; rss: 424MB     write metadata
  time: 0.606; rss: 448MB     translation item collection
  time: 0.044; rss: 458MB     codegen unit partitioning
  time: 0.000; rss: 456MB     write allocator module
  time: 0.057; rss: 493MB     llvm function passes [3ayaeypdcro9d6yk]
  time: 0.032; rss: 500MB     llvm function passes [4ezmh1vbs95c5ack]
  time: 0.189; rss: 500MB     llvm function passes [1im38lueib99jsk0]
  time: 0.065; rss: 508MB     llvm function passes [48hb0upc4kwkubdd]
  time: 0.059; rss: 515MB     llvm function passes [465ljw463knh9oxv]
  time: 0.270; rss: 518MB     llvm module passes [4ezmh1vbs95c5ack]
  time: 0.451; rss: 525MB     llvm module passes [3ayaeypdcro9d6yk]
  time: 0.080; rss: 525MB     llvm function passes [3z0m7pny1db0qcol]
  time: 0.078; rss: 535MB     llvm function passes [3ysg602ly0el3m63]
  time: 0.356; rss: 536MB     llvm module passes [465ljw463knh9oxv]
  time: 0.492; rss: 545MB     codegen passes [4ezmh1vbs95c5ack]
  time: 0.074; rss: 548MB     llvm function passes [2jzrra8v7h6bfxot]
  time: 0.480; rss: 557MB     codegen passes [465ljw463knh9oxv]
  time: 0.526; rss: 559MB     llvm module passes [3ysg602ly0el3m63]
  time: 0.052; rss: 559MB     llvm function passes [5g7oj6pdicfz0n8g]
  time: 0.723; rss: 559MB     codegen passes [3ayaeypdcro9d6yk]
  time: 0.042; rss: 559MB     llvm function passes [47dqcamjlp23ma80]
  time: 0.469; rss: 560MB     llvm module passes [2jzrra8v7h6bfxot]
  time: 0.046; rss: 560MB     llvm function passes [1rnt618l5epcaf5a]
  time: 0.288; rss: 560MB     llvm module passes [47dqcamjlp23ma80]
  time: 0.352; rss: 560MB     llvm module passes [5g7oj6pdicfz0n8g]
  time: 1.471; rss: 560MB     llvm module passes [1im38lueib99jsk0]
  time: 0.304; rss: 563MB     llvm module passes [1rnt618l5epcaf5a]
  time: 1.630; rss: 567MB     llvm module passes [48hb0upc4kwkubdd]
  time: 0.646; rss: 567MB     codegen passes [3ysg602ly0el3m63]
  time: 0.047; rss: 568MB     llvm function passes [r5omkko2zyx5xap]
  time: 0.414; rss: 568MB     codegen passes [5g7oj6pdicfz0n8g]
  time: 0.445; rss: 568MB     codegen passes [47dqcamjlp23ma80]
  time: 0.050; rss: 569MB     llvm function passes [5205e1onhko1v9bb]
  time: 0.673; rss: 570MB     codegen passes [2jzrra8v7h6bfxot]
  time: 0.041; rss: 570MB     llvm function passes [n847vnkjamrby94]
  time: 0.447; rss: 571MB     codegen passes [1rnt618l5epcaf5a]
  time: 0.310; rss: 571MB     llvm module passes [r5omkko2zyx5xap]
  time: 0.034; rss: 571MB     llvm function passes [43v6g0y2xsxoggnt]
  time: 0.038; rss: 571MB     llvm function passes [2kjrmm4fe2aha78f]
  time: 0.554; rss: 571MB     codegen passes [48hb0upc4kwkubdd]
  time: 0.327; rss: 571MB     llvm module passes [5205e1onhko1v9bb]
  time: 0.266; rss: 571MB     llvm module passes [n847vnkjamrby94]
  time: 0.179; rss: 571MB     llvm module passes [43v6g0y2xsxoggnt]
  time: 0.033; rss: 571MB     llvm function passes [1fxq14vrn4hmbyv6]
  time: 0.200; rss: 571MB     llvm module passes [2kjrmm4fe2aha78f]
  time: 0.235; rss: 573MB     codegen passes [43v6g0y2xsxoggnt]
  time: 0.229; rss: 573MB     llvm module passes [1fxq14vrn4hmbyv6]
  time: 0.461; rss: 573MB     codegen passes [r5omkko2zyx5xap]
  time: 0.210; rss: 573MB     codegen passes [2kjrmm4fe2aha78f]
  time: 0.027; rss: 576MB     llvm function passes [3ohma1ovi35ipdvf]
  time: 0.028; rss: 576MB     llvm function passes [igixddv04l2lgm1]
  time: 0.382; rss: 576MB     codegen passes [n847vnkjamrby94]
  time: 0.031; rss: 576MB     llvm function passes [1s3socv0drccut20]
  time: 0.552; rss: 576MB     codegen passes [5205e1onhko1v9bb]
  time: 0.187; rss: 576MB     llvm module passes [3ohma1ovi35ipdvf]
  time: 0.211; rss: 576MB     llvm module passes [igixddv04l2lgm1]
  time: 0.027; rss: 576MB     llvm function passes [pqmjx25qpxkduz7]
  time: 0.318; rss: 576MB     codegen passes [1fxq14vrn4hmbyv6]
  time: 0.025; rss: 576MB     llvm function passes [4udalgaf9uvlu1ls]
  time: 0.200; rss: 578MB     llvm module passes [1s3socv0drccut20]
  time: 0.023; rss: 578MB     llvm function passes [3v6ldxkfnyn9z8to]
  time: 2.638; rss: 578MB     llvm module passes [3z0m7pny1db0qcol]
  time: 0.222; rss: 578MB     codegen passes [3ohma1ovi35ipdvf]
  time: 0.235; rss: 578MB     llvm module passes [pqmjx25qpxkduz7]
  time: 0.260; rss: 578MB     codegen passes [igixddv04l2lgm1]
  time: 0.159; rss: 578MB     llvm module passes [4udalgaf9uvlu1ls]
  time: 0.134; rss: 578MB     llvm module passes [3v6ldxkfnyn9z8to]
  time: 0.023; rss: 578MB     llvm function passes [14njzsqy34v27pbp]
  time: 0.029; rss: 579MB     llvm function passes [1az2n4f1o2beo0qj]
  time: 0.122; rss: 579MB     llvm module passes [14njzsqy34v27pbp]
  time: 0.296; rss: 579MB     codegen passes [1s3socv0drccut20]
  time: 0.161; rss: 579MB     codegen passes [3v6ldxkfnyn9z8to]
  time: 0.026; rss: 579MB     llvm function passes [gon14xphovlcp6p]
  time: 0.196; rss: 579MB     codegen passes [4udalgaf9uvlu1ls]
  time: 0.027; rss: 580MB     llvm function passes [17ac7x677l7novtq]
  time: 0.149; rss: 580MB     codegen passes [14njzsqy34v27pbp]
  time: 0.162; rss: 580MB     llvm module passes [1az2n4f1o2beo0qj]
  time: 0.025; rss: 583MB     llvm function passes [1y5dl2l7jz37yfca]
  time: 0.401; rss: 589MB     codegen passes [pqmjx25qpxkduz7]
  time: 0.179; rss: 589MB     llvm module passes [gon14xphovlcp6p]
  time: 0.024; rss: 589MB     llvm function passes [tj2ixsxea3sv2zn]
  time: 2.146; rss: 571MB     codegen passes [1im38lueib99jsk0]
  time: 0.147; rss: 571MB     llvm module passes [17ac7x677l7novtq]
  time: 0.137; rss: 571MB     llvm module passes [1y5dl2l7jz37yfca]
  time: 0.021; rss: 571MB     llvm function passes [9elsx31vb4it187]
  time: 0.195; rss: 572MB     codegen passes [1az2n4f1o2beo0qj]
  time: 0.124; rss: 572MB     llvm module passes [tj2ixsxea3sv2zn]
  time: 0.023; rss: 572MB     llvm function passes [e19kx9t7xhzajfl]
  time: 0.181; rss: 574MB     codegen passes [gon14xphovlcp6p]
  time: 0.022; rss: 574MB     llvm function passes [16u6js6g0l3k1ic6]
  time: 0.172; rss: 575MB     codegen passes [17ac7x677l7novtq]
  time: 0.162; rss: 575MB     codegen passes [1y5dl2l7jz37yfca]
  time: 0.022; rss: 569MB     llvm function passes [49a7n47po4ttqjl7]
  time: 0.159; rss: 556MB     llvm module passes [9elsx31vb4it187]
  time: 0.777; rss: 556MB     codegen passes [3z0m7pny1db0qcol]
  time: 0.019; rss: 556MB     llvm function passes [2rh2nqrury6fvx8z]
  time: 0.150; rss: 556MB     codegen passes [tj2ixsxea3sv2zn]
  time: 0.021; rss: 556MB     llvm function passes [1iwy7drxyv77inwz]
  time: 0.017; rss: 556MB     llvm function passes [4zl66r1wsr7b48kj]
  time: 0.154; rss: 556MB     llvm module passes [e19kx9t7xhzajfl]
  time: 0.087; rss: 557MB     llvm module passes [2rh2nqrury6fvx8z]
  time: 0.151; rss: 557MB     llvm module passes [16u6js6g0l3k1ic6]
  time: 0.109; rss: 557MB     llvm module passes [49a7n47po4ttqjl7]
  time: 0.080; rss: 557MB     llvm module passes [4zl66r1wsr7b48kj]
  time: 0.017; rss: 557MB     llvm function passes [59lji4qb7sxxjahl]
  time: 0.101; rss: 557MB     llvm module passes [1iwy7drxyv77inwz]
  time: 0.122; rss: 560MB     codegen passes [2rh2nqrury6fvx8z]
  time: 0.105; rss: 560MB     codegen passes [4zl66r1wsr7b48kj]
  time: 0.017; rss: 561MB     llvm function passes [1e8to978fgwgf6e2]
  time: 0.248; rss: 561MB     codegen passes [9elsx31vb4it187]
  time: 0.145; rss: 561MB     codegen passes [49a7n47po4ttqjl7]
  time: 0.114; rss: 561MB     llvm module passes [59lji4qb7sxxjahl]
  time: 0.185; rss: 560MB     codegen passes [e19kx9t7xhzajfl]
  time: 0.015; rss: 560MB     llvm function passes [sissnbvpmyff5cd]
  time: 0.016; rss: 560MB     llvm function passes [3vf6q63gluv0kwui]
  time: 0.015; rss: 560MB     llvm function passes [30qa8fm6wxg43n1f]
  time: 0.141; rss: 560MB     codegen passes [1iwy7drxyv77inwz]
  time: 0.019; rss: 560MB     llvm function passes [1jqy9ulaz8m6f8t5]
  time: 0.092; rss: 560MB     llvm module passes [1e8to978fgwgf6e2]
  time: 0.078; rss: 561MB     llvm module passes [30qa8fm6wxg43n1f]
  time: 0.257; rss: 561MB     codegen passes [16u6js6g0l3k1ic6]
  time: 0.097; rss: 560MB     llvm module passes [3vf6q63gluv0kwui]
  time: 0.109; rss: 560MB     llvm module passes [sissnbvpmyff5cd]
  time: 0.016; rss: 561MB     llvm function passes [40w4pxj77c2qx5gv]
  time: 0.152; rss: 561MB     codegen passes [59lji4qb7sxxjahl]
  time: 0.022; rss: 561MB     llvm function passes [56dly8q07ws8ucdq]
  time: 0.118; rss: 547MB     codegen passes [1e8to978fgwgf6e2]
  time: 0.098; rss: 540MB     codegen passes [3vf6q63gluv0kwui]
  time: 0.113; rss: 540MB     codegen passes [30qa8fm6wxg43n1f]
  time: 0.013; rss: 540MB     llvm function passes [3r2a9uv8m29eccgt]
  time: 0.091; rss: 540MB     llvm module passes [40w4pxj77c2qx5gv]
  time: 0.012; rss: 540MB     llvm function passes [3gnhnp9df7c0b32k]
  time: 0.021; rss: 540MB     llvm function passes [3ok8m0hfz28n805v]
  time: 0.170; rss: 541MB     llvm module passes [1jqy9ulaz8m6f8t5]
  time: 0.050; rss: 541MB     llvm module passes [3r2a9uv8m29eccgt]
  time: 0.127; rss: 541MB     llvm module passes [56dly8q07ws8ucdq]
  time: 0.063; rss: 541MB     llvm module passes [3gnhnp9df7c0b32k]
  time: 0.184; rss: 542MB     codegen passes [sissnbvpmyff5cd]
  time: 0.109; rss: 542MB     llvm module passes [3ok8m0hfz28n805v]
  time: 0.122; rss: 542MB     codegen passes [40w4pxj77c2qx5gv]
  time: 0.083; rss: 542MB     codegen passes [3r2a9uv8m29eccgt]
  time: 0.029; rss: 542MB     llvm function passes [hh4mz07x048j9ph]
  time: 0.014; rss: 542MB     llvm function passes [3171x0bwu82dptu7]
  time: 0.014; rss: 542MB     llvm function passes [48l6fea3viw0soou]
  time: 0.091; rss: 543MB     codegen passes [3gnhnp9df7c0b32k]
  time: 0.032; rss: 543MB     llvm module passes [3171x0bwu82dptu7]
  time: 0.014; rss: 543MB     llvm function passes [2w6xsa2hbi53xhak]
  time: 0.086; rss: 545MB     llvm module passes [48l6fea3viw0soou]
  time: 0.057; rss: 545MB     codegen passes [3171x0bwu82dptu7]
  time: 0.119; rss: 545MB     codegen passes [3ok8m0hfz28n805v]
  time: 0.184; rss: 546MB     codegen passes [56dly8q07ws8ucdq]
  time: 0.016; rss: 546MB     llvm function passes [4ypvbwho0bu5tnww]
  time: 0.017; rss: 546MB     llvm function passes [3cx7oljifvb206q7]
  time: 0.013; rss: 546MB     llvm function passes [2294r52351up0ltr]
  time: 0.242; rss: 546MB     codegen passes [1jqy9ulaz8m6f8t5]
  time: 0.104; rss: 546MB     llvm module passes [2w6xsa2hbi53xhak]
  time: 0.016; rss: 546MB     llvm function passes [8xzrsc1ux72v29j]
  time: 0.079; rss: 546MB     llvm module passes [4ypvbwho0bu5tnww]
  time: 0.070; rss: 546MB     llvm module passes [2294r52351up0ltr]
  time: 0.091; rss: 546MB     llvm module passes [3cx7oljifvb206q7]
  time: 0.048; rss: 546MB     llvm module passes [8xzrsc1ux72v29j]
  time: 0.121; rss: 546MB     codegen passes [48l6fea3viw0soou]
  time: 0.013; rss: 546MB     llvm function passes [5b1vh7iwaxrgdt9b]
  time: 0.126; rss: 547MB     codegen passes [2w6xsa2hbi53xhak]
  time: 0.012; rss: 547MB     llvm function passes [z5zxougvau3143v]
  time: 0.284; rss: 546MB     llvm module passes [hh4mz07x048j9ph]
  time: 0.066; rss: 547MB     llvm module passes [5b1vh7iwaxrgdt9b]
  time: 0.094; rss: 547MB     codegen passes [8xzrsc1ux72v29j]
  time: 0.011; rss: 547MB     llvm function passes [4tsl13uv2s1nsajg]
  time: 0.049; rss: 547MB     llvm module passes [z5zxougvau3143v]
  time: 0.120; rss: 547MB     codegen passes [3cx7oljifvb206q7]
  time: 0.121; rss: 547MB     codegen passes [2294r52351up0ltr]
  time: 0.135; rss: 547MB     codegen passes [4ypvbwho0bu5tnww]
  time: 0.010; rss: 547MB     llvm function passes [15hqaojt7la8auje]
  time: 0.010; rss: 547MB     llvm function passes [1bckfbx20w4sferb]
  time: 0.012; rss: 547MB     llvm function passes [4dcqyqsbmhhtnerv]
  time: 0.059; rss: 547MB     llvm module passes [4tsl13uv2s1nsajg]
  time: 0.050; rss: 547MB     llvm module passes [1bckfbx20w4sferb]
  time: 0.010; rss: 548MB     llvm function passes [1z365437kyqhqbpo]
  time: 0.078; rss: 548MB     codegen passes [z5zxougvau3143v]
  time: 0.064; rss: 548MB     llvm module passes [15hqaojt7la8auje]
  time: 0.063; rss: 548MB     llvm module passes [4dcqyqsbmhhtnerv]
  time: 0.117; rss: 548MB     codegen passes [5b1vh7iwaxrgdt9b]
  time: 0.009; rss: 549MB     llvm function passes [2nenxqune35ageq0]
  time: 0.099; rss: 549MB     codegen passes [4tsl13uv2s1nsajg]
  time: 0.067; rss: 549MB     llvm module passes [1z365437kyqhqbpo]
  time: 0.012; rss: 549MB     llvm function passes [2k6uuqb7174v2d23]
  time: 0.008; rss: 549MB     llvm function passes [3phxj0b9y9cnkg6s]
  time: 0.080; rss: 549MB     codegen passes [4dcqyqsbmhhtnerv]
  time: 0.103; rss: 549MB     codegen passes [1bckfbx20w4sferb]
  time: 0.048; rss: 549MB     llvm module passes [2nenxqune35ageq0]
  time: 0.010; rss: 549MB     llvm function passes [jtxtkd93cyq9dz]
  time: 0.120; rss: 550MB     codegen passes [15hqaojt7la8auje]
  time: 0.008; rss: 550MB     llvm function passes [1dwmkfa1tr0xv9vo]
  time: 0.047; rss: 550MB     llvm module passes [3phxj0b9y9cnkg6s]
  time: 0.266; rss: 550MB     codegen passes [hh4mz07x048j9ph]
  time: 0.008; rss: 550MB     llvm function passes [26ox35trp2krsc1y]
  time: 0.055; rss: 550MB     llvm module passes [jtxtkd93cyq9dz]
  time: 0.038; rss: 550MB     llvm module passes [1dwmkfa1tr0xv9vo]
  time: 0.102; rss: 550MB     codegen passes [1z365437kyqhqbpo]
  time: 0.099; rss: 550MB     llvm module passes [2k6uuqb7174v2d23]
  time: 0.067; rss: 550MB     codegen passes [2nenxqune35ageq0]
  time: 0.008; rss: 550MB     llvm function passes [46j2dk0vfr4uxylw]
  time: 0.009; rss: 550MB     llvm function passes [34m0bc8eil8rq8x0]
  time: 0.039; rss: 550MB     llvm module passes [26ox35trp2krsc1y]
  time: 0.064; rss: 550MB     codegen passes [3phxj0b9y9cnkg6s]
  time: 0.008; rss: 550MB     llvm function passes [572bgozz9kcwe4zq]
  time: 0.034; rss: 550MB     llvm module passes [34m0bc8eil8rq8x0]
  time: 0.043; rss: 550MB     llvm module passes [46j2dk0vfr4uxylw]
  time: 0.075; rss: 550MB     codegen passes [jtxtkd93cyq9dz]
  time: 0.070; rss: 550MB     codegen passes [1dwmkfa1tr0xv9vo]
  time: 0.053; rss: 550MB     codegen passes [26ox35trp2krsc1y]
  time: 0.009; rss: 550MB     llvm function passes [48227ijr3wai6q4n]
  time: 0.007; rss: 550MB     llvm function passes [mc7efy9d24y0i8q]
  time: 0.044; rss: 550MB     llvm module passes [572bgozz9kcwe4zq]
  time: 0.008; rss: 550MB     llvm function passes [4r2r6lplo8zbtmpj]
  time: 0.063; rss: 550MB     codegen passes [34m0bc8eil8rq8x0]
  time: 0.037; rss: 550MB     llvm module passes [mc7efy9d24y0i8q]
  time: 0.047; rss: 550MB     llvm module passes [48227ijr3wai6q4n]
  time: 0.007; rss: 550MB     llvm function passes [25v1f13ji7dg4cld]
  time: 0.125; rss: 550MB     codegen passes [2k6uuqb7174v2d23]
  time: 0.045; rss: 550MB     llvm module passes [4r2r6lplo8zbtmpj]
  time: 0.012; rss: 550MB     llvm function passes [5fdwelvxoca4arlk]
  time: 0.090; rss: 550MB     codegen passes [46j2dk0vfr4uxylw]
  time: 0.008; rss: 550MB     llvm function passes [1adz5g7vbdvg6ekb]
  time: 0.035; rss: 550MB     llvm module passes [25v1f13ji7dg4cld]
  time: 0.080; rss: 550MB     codegen passes [572bgozz9kcwe4zq]
  time: 0.009; rss: 550MB     llvm function passes [4sw9hz7i7fiueihz]
  time: 0.056; rss: 550MB     codegen passes [mc7efy9d24y0i8q]
  time: 0.007; rss: 550MB     llvm function passes [22xan7diy75j4y68]
  time: 0.054; rss: 550MB     codegen passes [4r2r6lplo8zbtmpj]
  time: 0.045; rss: 550MB     llvm module passes [5fdwelvxoca4arlk]
  time: 0.034; rss: 550MB     llvm module passes [1adz5g7vbdvg6ekb]
  time: 0.007; rss: 550MB     llvm function passes [4l5k3aw639b5lixu]
  time: 0.075; rss: 550MB     codegen passes [48227ijr3wai6q4n]
  time: 0.027; rss: 550MB     llvm module passes [4sw9hz7i7fiueihz]
  time: 0.006; rss: 550MB     llvm function passes [3kfx4ynvkmi2y9i5]
  time: 0.016; rss: 550MB     llvm module passes [4l5k3aw639b5lixu]
  time: 0.035; rss: 550MB     llvm module passes [22xan7diy75j4y68]
  time: 0.005; rss: 550MB     llvm function passes [3oqznv5oym7l3m4e]
  time: 0.064; rss: 550MB     codegen passes [25v1f13ji7dg4cld]
  time: 0.024; rss: 550MB     llvm module passes [3kfx4ynvkmi2y9i5]
  time: 0.028; rss: 550MB     codegen passes [4l5k3aw639b5lixu]
  time: 0.049; rss: 550MB     codegen passes [1adz5g7vbdvg6ekb]
  time: 0.007; rss: 550MB     llvm function passes [1dtnwzxvq606tnr]
  time: 0.029; rss: 550MB     llvm module passes [3oqznv5oym7l3m4e]
  time: 0.006; rss: 550MB     llvm function passes [2ofwpmfcte7i2okq]
  time: 0.067; rss: 550MB     codegen passes [5fdwelvxoca4arlk]
  time: 0.005; rss: 550MB     llvm function passes [1e698527iprj2v8f]
  time: 0.063; rss: 550MB     codegen passes [4sw9hz7i7fiueihz]
  time: 0.022; rss: 550MB     llvm module passes [1dtnwzxvq606tnr]
  time: 0.052; rss: 550MB     codegen passes [22xan7diy75j4y68]
  time: 0.005; rss: 550MB     llvm function passes [doar5ife0jn9b6h]
  time: 0.022; rss: 550MB     llvm module passes [2ofwpmfcte7i2okq]
  time: 0.005; rss: 550MB     llvm function passes [4brwxiorhmgsb6oc]
  time: 0.014; rss: 550MB     llvm module passes [1e698527iprj2v8f]
  time: 0.047; rss: 550MB     codegen passes [3kfx4ynvkmi2y9i5]
  time: 0.016; rss: 550MB     llvm module passes [doar5ife0jn9b6h]
  time: 0.008; rss: 550MB     llvm function passes [4jdnq7xfjeka1bt]
  time: 0.019; rss: 550MB     llvm module passes [4brwxiorhmgsb6oc]
  time: 0.030; rss: 550MB     codegen passes [1dtnwzxvq606tnr]
  time: 0.056; rss: 550MB     codegen passes [3oqznv5oym7l3m4e]
  time: 0.006; rss: 550MB     llvm function passes [3fx9fbs2n0iwz52h]
  time: 0.029; rss: 550MB     codegen passes [1e698527iprj2v8f]
  time: 0.004; rss: 550MB     llvm function passes [sbsvivd1d7mlhtc]
  time: 0.023; rss: 550MB     codegen passes [doar5ife0jn9b6h]
  time: 0.005; rss: 550MB     llvm function passes [2ovgillv9e5ri68u]
  time: 0.003; rss: 550MB     llvm function passes [45pc7c65foh9i35f]
  time: 0.046; rss: 550MB     codegen passes [2ofwpmfcte7i2okq]
  time: 0.017; rss: 550MB     llvm module passes [sbsvivd1d7mlhtc]
  time: 0.009; rss: 550MB     llvm module passes [45pc7c65foh9i35f]
  time: 0.033; rss: 550MB     codegen passes [4brwxiorhmgsb6oc]
  time: 0.005; rss: 550MB     llvm function passes [4a6qrte6oti37guj]
  time: 0.025; rss: 550MB     llvm module passes [3fx9fbs2n0iwz52h]
  time: 0.004; rss: 550MB     llvm function passes [3z1komjwj3l5r22l]
  time: 0.042; rss: 550MB     llvm module passes [4jdnq7xfjeka1bt]
  time: 0.020; rss: 550MB     llvm module passes [2ovgillv9e5ri68u]
  time: 0.012; rss: 550MB     llvm module passes [3z1komjwj3l5r22l]
  time: 0.025; rss: 550MB     llvm module passes [4a6qrte6oti37guj]
  time: 0.028; rss: 550MB     codegen passes [45pc7c65foh9i35f]
  time: 0.007; rss: 550MB     llvm function passes [4r0iran0bvwwo8il]
  time: 0.046; rss: 550MB     codegen passes [sbsvivd1d7mlhtc]
  time: 0.036; rss: 550MB     codegen passes [2ovgillv9e5ri68u]
  time: 0.004; rss: 550MB     llvm function passes [1z7yudhn3wrohxse]
  time: 0.033; rss: 550MB     codegen passes [3z1komjwj3l5r22l]
  time: 0.003; rss: 550MB     llvm function passes [1rv8n017ha9022uu]
  time: 0.056; rss: 550MB     codegen passes [3fx9fbs2n0iwz52h]
  time: 0.006; rss: 550MB     llvm function passes [1lehglngf287yfz]
  time: 0.017; rss: 550MB     llvm module passes [1z7yudhn3wrohxse]
  time: 0.003; rss: 550MB     llvm function passes [40mv2bo8bxf7ur21]
  time: 0.044; rss: 550MB     codegen passes [4a6qrte6oti37guj]
  time: 0.011; rss: 550MB     llvm module passes [1rv8n017ha9022uu]
  time: 0.004; rss: 550MB     llvm function passes [2jqywn86b2gsqohu]
  time: 0.008; rss: 550MB     llvm module passes [40mv2bo8bxf7ur21]
  time: 0.018; rss: 550MB     llvm module passes [1lehglngf287yfz]
  time: 0.013; rss: 550MB     llvm module passes [2jqywn86b2gsqohu]
  time: 0.005; rss: 550MB     llvm function passes [3ldk0i2zxftngav8]
  time: 0.049; rss: 551MB     llvm module passes [4r0iran0bvwwo8il]
  time: 0.017; rss: 551MB     codegen passes [40mv2bo8bxf7ur21]
  time: 0.029; rss: 551MB     codegen passes [1rv8n017ha9022uu]
  time: 0.039; rss: 551MB     codegen passes [1z7yudhn3wrohxse]
  time: 0.013; rss: 551MB     llvm module passes [3ldk0i2zxftngav8]
  time: 0.004; rss: 551MB     llvm function passes [3zbrxzb6y9zlvxbc]
  time: 0.005; rss: 551MB     llvm function passes [592kwuek16q2qu2b]
  time: 0.004; rss: 551MB     llvm function passes [1kduva7sc7em934m]
  time: 0.108; rss: 551MB     codegen passes [4jdnq7xfjeka1bt]
  time: 0.007; rss: 551MB     llvm module passes [592kwuek16q2qu2b]
  time: 0.038; rss: 551MB     codegen passes [1lehglngf287yfz]
  time: 0.037; rss: 551MB     codegen passes [2jqywn86b2gsqohu]
  time: 0.015; rss: 551MB     llvm module passes [3zbrxzb6y9zlvxbc]
  time: 0.005; rss: 551MB     llvm function passes [2mxskq2oqglom0th]
  time: 0.012; rss: 551MB     llvm module passes [1kduva7sc7em934m]
  time: 0.003; rss: 551MB     llvm function passes [3ao39u975okzm3fn]
  time: 0.028; rss: 551MB     codegen passes [3ldk0i2zxftngav8]
  time: 0.008; rss: 551MB     llvm module passes [2mxskq2oqglom0th]
  time: 0.003; rss: 551MB     llvm function passes [1mvmz58owquyropc]
  time: 0.023; rss: 551MB     codegen passes [592kwuek16q2qu2b]
  time: 0.009; rss: 551MB     llvm module passes [3ao39u975okzm3fn]
  time: 0.002; rss: 551MB     llvm function passes [150rozkmr95qg96z]
  time: 0.015; rss: 551MB     codegen passes [1kduva7sc7em934m]
  time: 0.008; rss: 551MB     llvm module passes [1mvmz58owquyropc]
  time: 0.004; rss: 551MB     llvm module passes [150rozkmr95qg96z]
  time: 0.004; rss: 551MB     llvm function passes [55ezy8i7h0n87k30]
  time: 0.002; rss: 551MB     llvm function passes [1zwd8n7bcl3vhvvh]
  time: 0.008; rss: 551MB     llvm module passes [55ezy8i7h0n87k30]
  time: 0.027; rss: 551MB     codegen passes [2mxskq2oqglom0th]
  time: 0.021; rss: 551MB     codegen passes [3ao39u975okzm3fn]
  time: 0.014; rss: 551MB     codegen passes [150rozkmr95qg96z]
  time: 0.007; rss: 551MB     llvm module passes [1zwd8n7bcl3vhvvh]
  time: 0.002; rss: 551MB     llvm function passes [33iciep0yulcoxru]
  time: 0.003; rss: 551MB     llvm function passes [3muv22izzqc0hgj1]
  time: 0.006; rss: 551MB     llvm module passes [33iciep0yulcoxru]
  time: 0.047; rss: 551MB     codegen passes [3zbrxzb6y9zlvxbc]
  time: 0.008; rss: 551MB     llvm module passes [3muv22izzqc0hgj1]
  time: 0.030; rss: 551MB     codegen passes [1mvmz58owquyropc]
  time: 0.003; rss: 551MB     llvm function passes [2qmcjvtdhrpmg33e]
  time: 0.002; rss: 551MB     llvm function passes [15kq92zzbmxot4k9]
  time: 0.005; rss: 551MB     llvm module passes [2qmcjvtdhrpmg33e]
  time: 0.005; rss: 551MB     llvm module passes [15kq92zzbmxot4k9]
  time: 0.098; rss: 551MB     codegen passes [4r0iran0bvwwo8il]
  time: 0.014; rss: 551MB     codegen passes [33iciep0yulcoxru]
  time: 0.021; rss: 551MB     codegen passes [1zwd8n7bcl3vhvvh]
  time: 0.002; rss: 551MB     llvm function passes [3rxo8ke71qaq5bog]
  time: 0.002; rss: 551MB     llvm function passes [5e173fvoily6w40j]
  time: 0.002; rss: 551MB     llvm function passes [4g8y2se10t8swbo4]
  time: 0.003; rss: 551MB     llvm module passes [3rxo8ke71qaq5bog]
  time: 0.004; rss: 551MB     llvm module passes [5e173fvoily6w40j]
  time: 0.005; rss: 551MB     llvm module passes [4g8y2se10t8swbo4]
  time: 0.025; rss: 551MB     codegen passes [3muv22izzqc0hgj1]
  time: 0.044; rss: 551MB     codegen passes [55ezy8i7h0n87k30]
  time: 0.003; rss: 551MB     llvm function passes [4bwka44cn8t3u4h3]
  time: 0.018; rss: 551MB     codegen passes [15kq92zzbmxot4k9]
  time: 0.012; rss: 551MB     codegen passes [5e173fvoily6w40j]
  time: 0.023; rss: 551MB     codegen passes [2qmcjvtdhrpmg33e]
  time: 0.002; rss: 551MB     llvm function passes [4oxej6yqxc1k2a95]
  time: 0.002; rss: 551MB     llvm function passes [5ebb5yolwxvddvyk]
  time: 0.015; rss: 551MB     codegen passes [3rxo8ke71qaq5bog]
  time: 0.002; rss: 551MB     llvm function passes [3vqga66adtqzi46h]
  time: 0.002; rss: 551MB     llvm function passes [4a6dgwgsyclvnmy1]
  time: 0.004; rss: 551MB     llvm module passes [4oxej6yqxc1k2a95]
  time: 0.002; rss: 551MB     llvm function passes [4ouap5dauqhasyja]
  time: 0.011; rss: 551MB     llvm module passes [4bwka44cn8t3u4h3]
  time: 0.003; rss: 551MB     llvm module passes [4a6dgwgsyclvnmy1]
  time: 0.008; rss: 551MB     llvm module passes [5ebb5yolwxvddvyk]
  time: 0.021; rss: 551MB     codegen passes [4g8y2se10t8swbo4]
  time: 0.004; rss: 551MB     llvm module passes [4ouap5dauqhasyja]
  time: 0.007; rss: 551MB     llvm module passes [3vqga66adtqzi46h]
  time: 0.003; rss: 551MB     llvm function passes [12xrdtnvst521u6k]
  time: 0.002; rss: 551MB     llvm function passes [49lx1q7cxvpykyv0]
  time: 0.013; rss: 551MB     codegen passes [4a6dgwgsyclvnmy1]
  time: 0.005; rss: 551MB     llvm module passes [12xrdtnvst521u6k]
  time: 0.020; rss: 551MB     codegen passes [4oxej6yqxc1k2a95]
  time: 0.015; rss: 551MB     codegen passes [4ouap5dauqhasyja]
  time: 0.018; rss: 551MB     codegen passes [5ebb5yolwxvddvyk]
  time: 0.007; rss: 551MB     llvm module passes [49lx1q7cxvpykyv0]
  time: 0.002; rss: 551MB     llvm function passes [hj2dvney1nysd85]
  time: 0.002; rss: 551MB     llvm function passes [teeueyfcrgmih9j]
  time: 0.002; rss: 551MB     llvm function passes [1gdd0eeoypyb1tc7]
  time: 0.021; rss: 551MB     codegen passes [3vqga66adtqzi46h]
  time: 0.006; rss: 551MB     llvm module passes [hj2dvney1nysd85]
  time: 0.002; rss: 551MB     llvm function passes [4myqx12c7xn3w3ha]
  time: 0.002; rss: 551MB     llvm module passes [4myqx12c7xn3w3ha]
  time: 0.009; rss: 551MB     llvm module passes [teeueyfcrgmih9j]
  time: 0.002; rss: 551MB     llvm function passes [3d8a7xmzoa2mh5wz]
  time: 0.019; rss: 551MB     codegen passes [12xrdtnvst521u6k]
  time: 0.014; rss: 551MB     codegen passes [49lx1q7cxvpykyv0]
  time: 0.010; rss: 551MB     llvm module passes [1gdd0eeoypyb1tc7]
  time: 0.002; rss: 551MB     llvm module passes [3d8a7xmzoa2mh5wz]
  time: 0.002; rss: 552MB     llvm function passes [3rngp6bm2u2q5z0y]
  time: 0.002; rss: 552MB     llvm module passes [3rngp6bm2u2q5z0y]
  time: 0.017; rss: 552MB     codegen passes [hj2dvney1nysd85]
  time: 0.002; rss: 552MB     llvm function passes [10zpgjy904xd287n]
  time: 0.047; rss: 552MB     codegen passes [4bwka44cn8t3u4h3]
  time: 0.016; rss: 552MB     codegen passes [4myqx12c7xn3w3ha]
  time: 0.002; rss: 552MB     llvm module passes [10zpgjy904xd287n]
  time: 0.002; rss: 552MB     llvm function passes [1wwwkwi6lwcfzrgf]
  time: 0.002; rss: 552MB     llvm function passes [1vut2eft6nlujjxr]
  time: 0.001; rss: 552MB     llvm module passes [1wwwkwi6lwcfzrgf]
  time: 0.015; rss: 552MB     codegen passes [3d8a7xmzoa2mh5wz]
  time: 0.001; rss: 552MB     llvm function passes [2ukomuz1ojhg0kbx]
  time: 0.013; rss: 552MB     codegen passes [3rngp6bm2u2q5z0y]
  time: 0.001; rss: 552MB     llvm module passes [2ukomuz1ojhg0kbx]
  time: 0.003; rss: 552MB     llvm module passes [1vut2eft6nlujjxr]
  time: 0.001; rss: 552MB     llvm function passes [3s7t9xcxv68t1wrs]
  time: 0.023; rss: 552MB     codegen passes [1gdd0eeoypyb1tc7]
  time: 0.001; rss: 552MB     llvm module passes [3s7t9xcxv68t1wrs]
  time: 0.002; rss: 552MB     llvm function passes [3ab2w6r2t45b4bca]
  time: 0.013; rss: 552MB     codegen passes [10zpgjy904xd287n]
  time: 0.002; rss: 552MB     llvm module passes [3ab2w6r2t45b4bca]
  time: 0.001; rss: 552MB     llvm function passes [4z2120nemh2dbatt]
  time: 0.012; rss: 552MB     codegen passes [1wwwkwi6lwcfzrgf]
  time: 0.009; rss: 552MB     codegen passes [2ukomuz1ojhg0kbx]
  time: 0.002; rss: 552MB     llvm module passes [4z2120nemh2dbatt]
  time: 0.002; rss: 552MB     llvm function passes [v6ozwtpojmqfurc]
  time: 0.001; rss: 552MB     llvm module passes [v6ozwtpojmqfurc]
  time: 0.001; rss: 552MB     llvm function passes [2khut0u75xz4pny6]
  time: 0.001; rss: 552MB     llvm module passes [2khut0u75xz4pny6]
  time: 0.014; rss: 552MB     codegen passes [1vut2eft6nlujjxr]
  time: 0.009; rss: 552MB     codegen passes [3ab2w6r2t45b4bca]
  time: 0.012; rss: 552MB     codegen passes [3s7t9xcxv68t1wrs]
  time: 0.002; rss: 552MB     llvm function passes [8r09oxna9v9y0gg]
  time: 0.001; rss: 552MB     llvm function passes [xs5eceuco9v0zom]
  time: 0.001; rss: 552MB     llvm module passes [xs5eceuco9v0zom]
  time: 0.003; rss: 552MB     llvm module passes [8r09oxna9v9y0gg]
  time: 0.002; rss: 552MB     llvm function passes [10rmhugy7b1lwpf5]
  time: 0.001; rss: 552MB     llvm function passes [5frs3mx5dzjbj7u6]
  time: 0.009; rss: 552MB     codegen passes [v6ozwtpojmqfurc]
  time: 0.011; rss: 552MB     codegen passes [4z2120nemh2dbatt]
  time: 4.757; rss: 552MB     translate to LLVM IR
  time: 0.001; rss: 552MB     llvm module passes [5frs3mx5dzjbj7u6]
  time: 0.009; rss: 552MB     codegen passes [2khut0u75xz4pny6]
  time: 0.002; rss: 552MB     llvm module passes [10rmhugy7b1lwpf5]
  time: 0.001; rss: 552MB     assert dep graph
  time: 0.002; rss: 552MB     llvm function passes [2r82puffnvvb8iic]
  time: 0.001; rss: 552MB     llvm function passes [1zeawhkbeobww1zn]
  time: 0.001; rss: 552MB     llvm module passes [1zeawhkbeobww1zn]
  time: 0.001; rss: 552MB     llvm module passes [2r82puffnvvb8iic]
  time: 0.003; rss: 552MB     llvm function passes [54angscl5j2gyd27]
  time: 0.012; rss: 552MB     codegen passes [xs5eceuco9v0zom]
  time: 0.010; rss: 552MB     codegen passes [5frs3mx5dzjbj7u6]
  time: 0.003; rss: 552MB     llvm module passes [54angscl5j2gyd27]
  time: 0.008; rss: 552MB     codegen passes [1zeawhkbeobww1zn]
  time: 0.011; rss: 552MB     codegen passes [10rmhugy7b1lwpf5]
  time: 0.009; rss: 552MB     codegen passes [2r82puffnvvb8iic]
  time: 0.016; rss: 552MB     codegen passes [8r09oxna9v9y0gg]
  time: 0.001; rss: 552MB     llvm function passes [lff0vsgbs8l2d3m]
  time: 0.001; rss: 552MB     llvm module passes [lff0vsgbs8l2d3m]
  time: 0.008; rss: 552MB     codegen passes [54angscl5j2gyd27]
  time: 0.066; rss: 552MB     codegen passes [teeueyfcrgmih9j]
  time: 0.006; rss: 553MB     codegen passes [lff0vsgbs8l2d3m]
  time: 5.904; rss: 553MB     LLVM passes
  time: 0.074; rss: 553MB     persist query result cache
  time: 0.117; rss: 553MB     persist dep-graph
  time: 0.192; rss: 553MB     serialize dep graph
  time: 7.195; rss: 553MB     translation
  time: 0.001; rss: 384MB     serialize work products
  time: 8.988; rss: 386MB     running linker
  time: 9.113; rss: 386MB     linking
  Finished dev [optimized + debuginfo] target(s) in 40.14 secs

Win 8.1, rustc 1.26.0-nightly (2789b06 2018-03-06)

The build before that one (also after just touching a src file) took 42 seconds.
This is a lot, especially considering that cargo check in sublime and cargo watch -x run can't run in parallel, so when I save a file in Sublime, they always have to run both, and the order is random, whoever gets the lock first. And 80% of the time, cargo watch -x run gets the lock first and then I will only get the inline errors in sublime after both have finished..

So, please at least allow running check and build/run in parallel, not exclusively!

@SimonSapin
Copy link
Contributor

So, please at least allow running check and build/run in parallel, not exclusively!

That sounds unrelated to this issue, consider opening a new one (in the cargo repository).

@michaelwoerister
Copy link
Member

@Boscop, are these timings with incremental compilation enabled?

@jasonwilliams
Copy link
Member

jasonwilliams commented Mar 20, 2018

Don't delete the output artifacts. The .ilk and .exe or .dll must remain from the previous run.

@retep998 @alexcrichton are these all generated in the target folder?

@alexcrichton
Copy link
Member

@Jayflux I'm not sure, but the incremental folder can be assumed to be preserved and so intermediate artifacts can be stored somewhere in there.

@jasonwilliams
Copy link
Member

jasonwilliams commented Mar 20, 2018

Don't pass /OPT to the linker or any other flag that is mutually exclusive with incremental linking.

Unless ive got this wrong, this bit of work has already been done

@michaelwoerister
Copy link
Member

The incremental folder stores object files, but before linking they are copied to where the compiler would otherwise generate them. The final executable/dll is not touched by incremental compilation. I don't know if we have an explicit step in the compiler that would delete it before invoking the linker.

@Boscop
Copy link

Boscop commented Mar 21, 2018

@michaelwoerister Incremental is enabled by default, right? So then it must be enabled.

@michaelwoerister
Copy link
Member

@Boscop It's only the default for debug builds and cargo check. The output above says Finished dev [optimized + debuginfo] target(s), so I'm wondering. On the other hand, it shows a very high number of object files being generated, which usually indicates incremental compilation. If you run cargo with --verbose, then we'd know for sure.

If this is with incremental compilation enabled then this is some kind of bug or at least a severe corner case that we should investigate. Just touching a file is usually the best case scenario and no object files should have to be recompiled.

@Boscop
Copy link

Boscop commented Mar 26, 2018

I have this in my Cargo.toml:

[profile.dev]
incremental = true
opt-level = 1

Because otherwise it was too slow (for real-time audio) in debug mode and using too much cpu..

Is there a way I can keep the opt-level but make the compilation faster?

@michaelwoerister
Copy link
Member

@Boscop This should not be re-compiling so much with incremental compilation after just touching a file. Could you open an issue about this, if possible with a way to reproduce?

I don't know of a way to make this faster. As long as incremental compilation doesn't work for your project, you should turn it off and use codegen-units = 4 (or however many CPU cores you have) instead.

@jasonwilliams
Copy link
Member

What is there to do in this issue?
Are the OP instructions still valid?

@jasonwilliams
Copy link
Member

The long compilation times are still a problem

@jasonwilliams
Copy link
Member

On Servo my build is much faster after i set my local cargo to use lld-link.exe from LLVM.
Downloaded from https://llvm.org/builds/ then

[target.x86_64-pc-windows-msvc]
linker = "lld-link.exe"

@Boscop
Copy link

Boscop commented Jun 7, 2018

@jasonwilliams Did you download the win32 or win64 version?

@jasonwilliams
Copy link
Member

jasonwilliams commented Jun 8, 2018

@Boscop i used the win32 version, any particular reason you ask?
Looking again at the LLVM website i see there is a 64bit version, i may try that

@jasonwilliams
Copy link
Member

@Boscop This should not be re-compiling so much with incremental compilation after just touching a file. Could you open an issue about this, if possible with a way to reproduce?

@michaelwoerister how can i reproduce this isssue?

@pnkfelix pnkfelix added the A-linkage Area: linking into static, shared libraries and binaries label Sep 20, 2018
@jonas-schievink jonas-schievink added I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2020
@mmgeorge
Copy link

mmgeorge commented Aug 18, 2024

Any plans to still consider supporting this? Linking is still a pain point on incremental builds (often takes almost all the time), & it would be great if we could take advantage of this on windows. Trying to proxy project deps through a dylib is fairly cumbersome, as it quickly falls into you needing to pass -Cprefer-dynamic & then patch deps to other dylib proxies.

I tried passing -Clink-args=/INCREMENTAL, but I'm not seeing any .ilk files in the build directory. (-Clink-args=/DEBUG:NONE does however help quite a bit by disabling the .pbds)

@bjorn3
Copy link
Member

bjorn3 commented Aug 18, 2024

Is lld-link.exe fast enough? My understanding is that modern (almost) fully parallel linkers like lld are often just as fast as incremental linking with old school (mostly) non-parallel linkers like link.exe.

@mmgeorge
Copy link

mmgeorge commented Aug 19, 2024

lld definitely seems faster than link. Though maybe the gap between them has been brought down [2019, 2021]? Here's some very rough numbers using a pretty contrived example that pulls in a bunch of deps. In my project I'm building a dylib that I then hot reload in my main program, so I'm seeing now that linking the dylib (along with -Zshare-generics=n -Cprefer-dynamic), appears to increase link times quite a bit vs a fully static lib:

Machine: CPU=AMD 7700X, RAM=32GB 4400Mhz DDR5, SSD=RefS-formatted Samsung 990 Pro
With lib as dylib, imported by main (for hot-reloading):

linker full /DEBUG:NONE
link.exe 6.70 4.03
rust-lld 5.05 2.74

With static lib:

linker full
link.exe 4.0
rust-lld 3.78

Machine: CPU=i7-7700HQ, RAM=16GB 2400MHz DDR4, SSD=Samsung MZVLV256HCHP
With lib as dylib, imported by main (for hot-reloading):

linker full /DEBUG:NONE
link.exe 15.34 10.31
rust-lld 12.74 7

I'm not sure how parallel lld is, eyeballing the task manager it only looked like 3 threads were getting used (vs what looked like 2 for link?), admittedly not very scientific on my end 😆. Curious on how mold would perform here.


It's a good point that it warrants seeing if link.exe + /INCREMENTAL is actually faster than lld. Looking online, I'm not really even seeing much info concerning link.exe full vs incremental other than https://devtalk.blender.org/t/speed-up-c-compilation/30508/14

Disk Full Hot Full Cold Incremental Hot Incremental Cold
HDD 27.375 218.187 7.688 164.324
SDD 24.381 56.774 7.627 11.887

If we also see a 3x improvement then that would be pretty great for incremental builds. On the other hand, it looks like incremental linking can also run into the problems reported in godotengine/godot#77968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests