summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/term/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src/term/mod.rs')
-rw-r--r--alacritty_terminal/src/term/mod.rs60
1 files changed, 0 insertions, 60 deletions
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);
- }
- })
- }
-}