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 /alacritty_terminal/src/term/mod.rs | |
parent | 753c4ed19ed026fabfad98b9874c54eb4bdcf8f0 (diff) | |
download | alacritty-7291702f6b4fff10f2470f084abe0785b95659a0.tar.gz alacritty-7291702f6b4fff10f2470f084abe0785b95659a0.zip |
Remove all rustc benchmarks
Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty_terminal/src/term/mod.rs')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 60 |
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); - } - }) - } -} |