# Cargo `--timings` visualizations
Playing around with cargo and CSS to see if we can make nicer `--timings` HTML output.
## How this "works"
All of the data is manually collected, via harvesting existing info in the JS of `cargo_timings.html` and some hacky processing of `cargo-depgraph`. There is a `Crate` class that is responsible for (very, very inefficiently) processing all of the timings data.
### Heatmap
Starting at final crate:
1. Set size to cost of self and all dependencies
2. Set color to amount compilation units it unlocks (more red = more directly blocking)
3. Repeat steps for each dependency
## How it should be done
Goals:
- Performant
- Light-weight
- Simple
Similar to existing timings code, I would probably generate the same html (or maybe equivalent svg) in Rust, then shove it straight into an HTML file. JS should only be responsible for interactivity such as switching color palette, tweaking layouts, viewing more information, changing what color is represented etc. I think a graph library would add too much bloat for somthing that would (ideally) get shipped with cargo.