revme/cmd/
bench.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pub mod analysis;
pub mod burntpix;
pub mod snailtracer;
pub mod transfer;

use clap::{Parser, ValueEnum};

#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum BenchName {
    Analysis,
    Burntpix,
    Snailtracer,
    Transfer,
}

/// `bytecode` subcommand.
#[derive(Parser, Debug)]
pub struct Cmd {
    #[arg(value_enum)]
    name: BenchName,
}

impl Cmd {
    /// Run bench command.
    pub fn run(&self) {
        match self.name {
            BenchName::Analysis => analysis::run(),
            BenchName::Burntpix => burntpix::run(),
            BenchName::Snailtracer => snailtracer::run(),
            BenchName::Transfer => transfer::run(),
        }
    }
}