Skip to content

option to print total crate build time #5046

Closed
@matthiaskrgr

Description

@matthiaskrgr

Using RUSTFLAGS="-Z time-passes" it is possible to see how long a crate needs to build but when building all the dependencies the total build time of a dependency is not shown.
I would be neat to have cargo print the time it took to build a single crate with some debug option maybe.
There's something similar already for rustc bootstrap on travis:

Building stage2 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:51:16]   Compiling version_check v0.1.4
[00:51:16]   Compiling nodrop v0.1.12
[00:51:16]   Compiling cfg-if v0.1.5
[00:51:16]   Compiling void v1.0.2
[00:51:16] [RUSTC-TIMING] cfg_if test:false 0.092
[00:51:16]   Compiling memoffset v0.2.1
[00:51:16] [RUSTC-TIMING] nodrop test:false 0.126
[00:51:16]   Compiling scopeguard v0.3.3
[00:51:16] [RUSTC-TIMING] void test:false 0.139
[00:51:16]   Compiling stable_deref_trait v1.1.0
[00:51:16] [RUSTC-TIMING] memoffset test:false 0.102
[00:51:16]   Compiling libc v0.2.43
[00:51:16] [RUSTC-TIMING] stable_deref_trait test:false 0.130
[00:51:16] [RUSTC-TIMING] scopeguard test:false 0.156
[00:51:16]   Compiling rustc-rayon-core v0.1.1
[00:51:16]   Compiling rand_core v0.2.1
[00:51:17] [RUSTC-TIMING] rand_core test:false 1.035
[00:51:17]   Compiling either v1.5.0
[00:51:17]   Compiling byteorder v1.2.3
[00:51:18] [RUSTC-TIMING] either test:false 0.391
[00:51:18]   Compiling bitflags v1.0.4
[00:51:18] [RUSTC-TIMING] bitflags test:false 0.110
[00:51:18]   Compiling unicode-width v0.1.5
[00:51:18] [RUSTC-TIMING] unicode_width test:false 0.211
[00:51:18]   Compiling cc v1.0.22
[00:51:18] [RUSTC-TIMING] libc test:false 2.072
[00:51:18]   Compiling rustc_target v0.0.0 (file:///checkout/src/librustc_target)
[00:51:19] [RUSTC-TIMING] byteorder test:false 1.130
[00:51:19]   Compiling scoped-tls v0.1.2
[00:51:19]   Compiling syntax v0.0.0 (file:///checkout/src/libsyntax)
[00:51:19] [RUSTC-TIMING] scoped_tls test:false 0.314
[00:51:19]   Compiling termcolor v1.0.2
[00:51:19]   Compiling lazy_static v0.2.11
[00:51:19]   Compiling rustc-demangle v0.1.9
[00:51:19] [RUSTC-TIMING] lazy_static test:false 0.167
[00:51:19]   Compiling remove_dir_all v0.5.1
[00:51:20] [RUSTC-TIMING] remove_dir_all test:false 0.107
[00:51:20]   Compiling rustc v0.0.0 (file:///checkout/src/librustc)
[00:51:20]   Compiling datafrog v0.1.0
[00:51:21] [RUSTC-TIMING] datafrog test:false 0.587
[00:51:22]   Compiling fmt_macros v0.0.0 (file:///checkout/src/libfmt_macros)
[00:51:23] [RUSTC-TIMING] termcolor test:false 3.567
[00:51:23] [RUSTC-TIMING] rustc_demangle test:false 4.023
[00:51:23]   Compiling graphviz v0.0.0 (file:///checkout/src/libgraphviz)
[00:51:24] [RUSTC-TIMING] fmt_macros test:false 2.046
[00:51:24]   Compiling rustc_fs_util v0.0.0 (file:///checkout/src/librustc_fs_util)
[00:51:25] [RUSTC-TIMING] graphviz test:false 1.742
[00:51:25] [RUSTC-TIMING] rustc_fs_util test:false 0.769

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions