diff options
author | James McCoy <jamessan@jamessan.com> | 2021-01-21 14:45:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 19:45:33 +0000 |
commit | 7291702f6b4fff10f2470f084abe0785b95659a0 (patch) | |
tree | e39a9c24608db9b661d947059acac18b30d90ca5 | |
parent | 753c4ed19ed026fabfad98b9874c54eb4bdcf8f0 (diff) | |
download | alacritty-7291702f6b4fff10f2470f084abe0785b95659a0.tar.gz alacritty-7291702f6b4fff10f2470f084abe0785b95659a0.zip |
Remove all rustc benchmarks
Co-authored-by: Christian Duerr <contact@christianduerr.com>
-rw-r--r-- | alacritty/Cargo.toml | 1 | ||||
-rw-r--r-- | alacritty/src/main.rs | 1 | ||||
-rw-r--r-- | alacritty_terminal/Cargo.toml | 4 | ||||
-rw-r--r-- | alacritty_terminal/src/lib.rs | 1 | ||||
-rw-r--r-- | alacritty_terminal/src/term/cell.rs | 20 | ||||
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 60 | ||||
-rw-r--r-- | alacritty_terminal/src/term/search.rs | 23 |
7 files changed, 0 insertions, 110 deletions
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index b1055f5c..73724fbe 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -65,4 +65,3 @@ default = ["wayland", "x11"] x11 = ["copypasta/x11", "glutin/x11", "x11-dl", "png"] wayland = ["copypasta/wayland", "glutin/wayland", "wayland-client"] nightly = [] -bench = [] diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs index 0e27c893..1bcf64b9 100644 --- a/alacritty/src/main.rs +++ b/alacritty/src/main.rs @@ -3,7 +3,6 @@ #![warn(rust_2018_idioms, future_incompatible)] #![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)] #![cfg_attr(feature = "cargo-clippy", deny(warnings))] -#![cfg_attr(all(test, feature = "bench"), feature(test))] // With the default subsystem, 'console', windows creates an additional console // window for the program. // This is silently ignored on non-windows systems. diff --git a/alacritty_terminal/Cargo.toml b/alacritty_terminal/Cargo.toml index ad2009cb..ee228a3f 100644 --- a/alacritty_terminal/Cargo.toml +++ b/alacritty_terminal/Cargo.toml @@ -39,9 +39,5 @@ winapi = { version = "0.3.7", features = [ ]} mio-anonymous-pipes = "0.1" -[features] -default = [] -bench = [] - [dev-dependencies] serde_json = "1.0.0" diff --git a/alacritty_terminal/src/lib.rs b/alacritty_terminal/src/lib.rs index abeba531..5f80e283 100644 --- a/alacritty_terminal/src/lib.rs +++ b/alacritty_terminal/src/lib.rs @@ -3,7 +3,6 @@ #![warn(rust_2018_idioms, future_incompatible)] #![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)] #![cfg_attr(feature = "cargo-clippy", deny(warnings))] -#![cfg_attr(all(test, feature = "bench"), feature(test))] pub mod ansi; pub mod config; diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index 8ac3edd0..91ee3391 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -192,23 +192,3 @@ mod tests { assert_eq!(row.line_length(), Column(10)); } } - -#[cfg(all(test, feature = "bench"))] -mod benches { - extern crate test; - - use super::*; - - #[bench] - fn cell_reset(b: &mut test::Bencher) { - b.iter(|| { - let mut cell = Cell::default(); - - for _ in 0..100 { - cell = test::black_box(Color::Named(NamedColor::Foreground).into()); - } - - test::black_box(cell); - }); - } -} diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 70d670fe..62bbc7c4 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -2376,63 +2376,3 @@ mod tests { assert_eq!(version_number("999.99.99"), 9_99_99_99); } } - -#[cfg(all(test, feature = "bench"))] -mod benches { - extern crate serde_json as json; - extern crate test; - - use std::fs; - use std::mem; - - use crate::config::MockConfig; - use crate::event::{Event, EventListener}; - use crate::grid::Grid; - - use super::cell::Cell; - use super::{SizeInfo, Term}; - - struct Mock; - impl EventListener for Mock { - fn send_event(&self, _event: Event) {} - } - - /// Benchmark for the renderable cells iterator. - /// - /// The renderable cells iterator yields cells that require work to be - /// displayed (that is, not an empty background cell). This benchmark - /// measures how long it takes to process the whole iterator. - /// - /// When this benchmark was first added, it averaged ~78usec on my macbook - /// pro. The total render time for this grid is anywhere between ~1500 and - /// ~2000usec (measured imprecisely with the visual meter). - #[bench] - fn render_iter(b: &mut test::Bencher) { - // Need some realistic grid state; using one of the ref files. - let serialized_grid = fs::read_to_string(concat!( - env!("CARGO_MANIFEST_DIR"), - "/tests/ref/vim_large_window_scroll/grid.json" - )) - .unwrap(); - let serialized_size = fs::read_to_string(concat!( - env!("CARGO_MANIFEST_DIR"), - "/tests/ref/vim_large_window_scroll/size.json" - )) - .unwrap(); - - let mut grid: Grid<Cell> = json::from_str(&serialized_grid).unwrap(); - let size: SizeInfo = json::from_str(&serialized_size).unwrap(); - - let config = MockConfig::default(); - - let mut terminal = Term::new(&config, size, Mock); - mem::swap(&mut terminal.grid, &mut grid); - - b.iter(|| { - let iter = terminal.renderable_cells(&config, true); - for cell in iter { - test::black_box(cell); - } - }) - } -} diff --git a/alacritty_terminal/src/term/search.rs b/alacritty_terminal/src/term/search.rs index 712daa92..b7aaaaba 100644 --- a/alacritty_terminal/src/term/search.rs +++ b/alacritty_terminal/src/term/search.rs @@ -770,26 +770,3 @@ mod tests { assert_eq!(term.regex_search_left(start, end), Some(match_start..=match_end)); } } - -#[cfg(all(test, feature = "bench"))] -mod benches { - extern crate test; - - use super::*; - - use crate::term::test::mock_term; - - #[bench] - fn regex_search(b: &mut test::Bencher) { - let input = format!("{:^10000}", "Alacritty"); - let mut term = mock_term(&input); - term.regex_search = Some(RegexSearch::new(" Alacritty ").unwrap()); - let start = Point::new(0, Column(0)); - let end = Point::new(0, Column(input.len() - 1)); - - b.iter(|| { - test::black_box(term.regex_search_right(start, end)); - test::black_box(term.regex_search_left(end, start)); - }); - } -} |