mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
3d7e88e8a9
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.
1 line
No EOL
100 B
JSON
1 line
No EOL
100 B
JSON
{"width":2532.0,"height":1380.0,"cell_width":9.0,"cell_height":19.0,"padding_x":3.0,"padding_y":3.0} |