`cargo web start --auto-reload` compile time statistics

I have a cargo web start --auto-reload that runs constantly while I code.

My workspace is up to ~50 crates now, and is sometimes, recompilation is (understandably) slow.

I'm wondering if there is a way to collect 'crate level' compile statistics, i.e. things like:

  • how often is this crate recompiled
  • when I edit a file in crate foo, how long does it take to recompile foo; how long does it take to recompile everything that depends on foo, etc ...

I feel like this type of statistics would be hugely useful in figuring out how the "dag dependency tree" should be structured, i.e. things of the form "I had no idea that whenever I edited FOO, it caused ALL THESE recompiles"

cargo tree might be helpful.

cargo tree is really nice, but it looks like it's computed 100% based on the source code.

What I would like if we could get statistics annotated on the cargo tree nodes -- i.e., for each node:

  • how often was this crate recompiled in the past day, past week?
  • avg / std dev for compile time of this crate
  • avg / std dev for (sum of all crates that depend on this crate)
    etc ...