Skip re-generating `--timings=json` on every run

finchie
Apr 22, 2024, 8:28 AM
PJPTNU2SXAGBBBVDFZMHHRMC6X5UGOPBJWT7DP5YXOZKQKGLKHWQC

Dependencies

  • [2] T34OV3YQ Store timings output in `timings::Output` struct
  • [3] 7CVIL7UJ Create simple metadata parser
  • [4] ZPFD3275 Switch from `cargo_metadata`+`petgraph` to `guppy`
  • [5] UQJO24KB Use `forceatlas2` to construct graph layout
  • [6] LOR3KOXG Parse JSON output from `cargo build --timings`

Change contents

  • replacement in src/timings.rs at line 82
    [2.227][2.227:254]()
    pub fn new() -> Self {
    [2.227]
    [2.254]
    pub fn generate() -> Vec<u8> {
  • replacement in src/timings.rs at line 93
    [2.598][2.598:648]()
    let timings_ouput = Command::new("cargo")
    [2.598]
    [2.648]
    let timings_output = Command::new("cargo")
  • edit in src/timings.rs at line 105
    [2.960]
    [3.1565]
    timings_output.stdout
    }
  • edit in src/timings.rs at line 108
    [3.1566]
    [2.961]
    pub fn new(source_data: &[u8]) -> Self {
  • replacement in src/timings.rs at line 110
    [2.1003][2.1003:1085]()
    let mut timings_buffer = BufReader::new(timings_ouput.stdout.as_slice());
    [2.1003]
    [2.1085]
    let mut timings_buffer = BufReader::new(source_data);
  • replacement in src/main.rs at line 8
    [3.718][2.2252:2294]()
    let timings = timings::Output::new();
    [3.718]
    [3.2757]
    // Skip rebuilding every time by caching the output from `--timings=json` as a local file
    let source_data = include_bytes!("../timings.stdout");
    let timings = timings::Output::new(source_data);