1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-25 14:05:41 -05:00
alacritty/tests/ref/grid_reset
Christian Duerr 3d7e88e8a9
Dynamically initialize grid storage
Previously Alacritty has initialized all lines in the buffer as soon as
it is started. This had the effect that terminals which aren't making
use of the scrollback buffer yet, would still consume large amounts of
memory, potentially even freezing the system at startup.

To resolve this problem, the grid is now dynamically resized in chunks
of `1000` rows. The initial size is just the visible area itself, then
every time lines are written to the terminal emulator, the grid storage
is grown when required.

With the worst-case scenario of having 100_000 lines scrollback
configured, this change improves startup performance at the cost of
scrolling performance.

On my machine the startup changes from ~0.3 to ~0.2 seconds.

The scrolling performance with large throughput is not affected, however
it is slowed down when the number of lines scrolled are close to the
100_000 configured as scrollback. The most taxing benchmark I've found
for this was running `yes | dd count=500 > 500.txt` (note the relatively
small file size). This will cause a slowdown on the first run from 0.05s
to 0.15s. While this is significant, it lines up with the time saved at
startup.

This fixes #1236.
2018-09-24 18:40:09 +00:00
..
alacritty.recording Dynamically initialize grid storage 2018-09-24 18:40:09 +00:00
config.json Truncate invisible lines before storing ref-tests 2018-06-02 09:56:50 -07:00
grid.json Dynamically initialize grid storage 2018-09-24 18:40:09 +00:00
size.json Dynamically initialize grid storage 2018-09-24 18:40:09 +00:00