alacritty/alacritty_terminal/src
Christian Duerr 3c61e075fe
Improve rendering performance
This PR combines a couple of optimizations to drastically reduce the
time it takes to gather everything necessary for rendering Alacritty's
terminal grid.

To help with the iteration over the grid, the `DisplayIter` which made
heavy use of dynamic dispatch has been replaced with a simple addition
to the `GridIterator` which also had the benefit of making the code a
little easier to understand.

The hints/search check for each cell was always performing an array
lookup before figuring out that the cell is not part of a hint or
search. Since the general case is that the cell is neither part of hints
or search, they've been wrapped in an `Option` to make verifying their
activity a simple `is_some()` check.

For some reason the compiler was also struggling with the `cursor`
method of the `RenderableContent`. Since the iterator is explicitly
drained, the performance took a hit of multiple milliseconds for a
single branch. Our implementation does never reach the case where
draining the iterator would be necessary, so this sanity check has just
been replaced with a `debug_assert`.

Overall this has managed to reduce the time it takes to collect all
renderable content from ~7-8ms in my large grid test to just ~3-4ms.
2021-05-22 22:48:43 +00:00
..
config Update dependencies 2021-02-13 18:15:57 +00:00
grid Improve rendering performance 2021-05-22 22:48:43 +00:00
term Improve rendering performance 2021-05-22 22:48:43 +00:00
tty Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
ansi.rs Fix out of order terminal query responses 2021-04-17 23:20:13 +00:00
event.rs Fix out of order terminal query responses 2021-04-17 23:20:13 +00:00
event_loop.rs Fix out of order terminal query responses 2021-04-17 23:20:13 +00:00
index.rs Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
lib.rs Remove all rustc benchmarks 2021-01-21 19:45:33 +00:00
selection.rs Improve rendering performance 2021-05-22 22:48:43 +00:00
sync.rs Remove copyright notice from files 2020-06-06 21:49:14 +03:00
thread.rs Add option to run command on bell 2020-07-10 22:32:44 +03:00
vi_mode.rs Unify the grid line indexing types 2021-03-30 23:25:38 +00:00