hotpath 0.15.0

Simple async Rust profiler with memory and data-flow insights - quickly find and debug performance bottlenecks.
Documentation
mod cmd;
use clap::{Parser, Subcommand};
use cmd::compare::CompareArgs;
use cmd::profile_pr::ProfilePrArgs;
use eyre::Result;

#[derive(Subcommand, Debug)]
pub enum HPSubcommand {
    #[command(about = "Profile a PR, compare with main branch, and post a GitHub comment")]
    ProfilePr(ProfilePrArgs),
    #[command(about = "Compare two JSON reports and print the diff")]
    Compare(CompareArgs),
}

#[derive(Parser, Debug)]
#[command(
    version,
    about,
    long_about = "hotpath CLI: automatically profile Rust programs on each Pull Request

https://github.com/pawurb/hotpath-rs"
)]
pub struct HPArgs {
    #[command(subcommand)]
    pub cmd: HPSubcommand,
}

fn main() -> Result<()> {
    let root_args = HPArgs::parse();

    match root_args.cmd {
        HPSubcommand::ProfilePr(args) => {
            args.run()?;
        }
        HPSubcommand::Compare(args) => {
            args.run()?;
        }
    }

    Ok(())
}