update benchmark

This commit is contained in:
Evan Almloff 2022-04-21 06:44:48 -05:00
parent efa682735e
commit 91b2147552
2 changed files with 15 additions and 60 deletions

View file

@ -17,62 +17,14 @@ fn tui_update(c: &mut Criterion) {
&size,
|b, size| {
b.iter(|| match size {
1 => dioxus::tui::launch_cfg(
app3,
Config {
headless: true,
..Default::default()
},
),
2 => dioxus::tui::launch_cfg(
app6,
Config {
headless: true,
..Default::default()
},
),
3 => dioxus::tui::launch_cfg(
app9,
Config {
headless: true,
..Default::default()
},
),
4 => dioxus::tui::launch_cfg(
app12,
Config {
headless: true,
..Default::default()
},
),
5 => dioxus::tui::launch_cfg(
app15,
Config {
headless: true,
..Default::default()
},
),
6 => dioxus::tui::launch_cfg(
app18,
Config {
headless: true,
..Default::default()
},
),
7 => dioxus::tui::launch_cfg(
app21,
Config {
headless: true,
..Default::default()
},
),
8 => dioxus::tui::launch_cfg(
app24,
Config {
headless: true,
..Default::default()
},
),
1 => dioxus::tui::launch_cfg(app3, Config::default().with_headless()),
2 => dioxus::tui::launch_cfg(app6, Config::default().with_headless()),
3 => dioxus::tui::launch_cfg(app9, Config::default().with_headless()),
4 => dioxus::tui::launch_cfg(app12, Config::default().with_headless()),
5 => dioxus::tui::launch_cfg(app15, Config::default().with_headless()),
6 => dioxus::tui::launch_cfg(app18, Config::default().with_headless()),
7 => dioxus::tui::launch_cfg(app21, Config::default().with_headless()),
8 => dioxus::tui::launch_cfg(app24, Config::default().with_headless()),
_ => (),
})
},

View file

@ -21,15 +21,18 @@ impl Config {
}
}
pub fn with_ctrl_c_quit(self, ctrl_c_quit: bool) -> Self {
pub fn with_ctrl_c_quit(self) -> Self {
Self {
ctrl_c_quit,
ctrl_c_quit: true,
..self
}
}
pub fn with_headless(self, headless: bool) -> Self {
Self { headless, ..self }
pub fn with_headless(self) -> Self {
Self {
headless: true,
..self
}
}
}