diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-04-30 00:22:15 +0200 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2018-06-02 09:56:50 -0700 |
commit | a3c6c1db63af8dea62146739dc183c05b26b56d6 (patch) | |
tree | 38401636ce539e7a7358e8eef23ed3d8cb83adb4 /src/logging.rs | |
parent | c01ce1e6ff3d36d0ec55707421e9f31fe000559f (diff) | |
download | alacritty-a3c6c1db63af8dea62146739dc183c05b26b56d6.tar.gz alacritty-a3c6c1db63af8dea62146739dc183c05b26b56d6.zip |
Improve the resizing implementation
Until now the resizing implementation with scrollback has been really
inefficient because it made use of APIs like `Vec::insert`. This has
been rewored with this commit.
A `len` property has been added to the `Storage` struct which keeps
track of the actual length of the raw buffer. This has changed both
shrinking and growing implementations.
With shrinking, no more lines are removed, only the `len` property is
updated to set all lines shrunk to an "invisible" state which cannot be
accessed from the outside, this effectively changes it to a O(1)
operation. The only issue with this would be memory consumption, but
since the maximum shrinkage is the number of lines on one screen, it
should be a rather small impacte (probabl <100 lines usually). If
desired it would be possible to change this to shrink the raw inner
buffer whenever there are more than X lines hidden.
Growing now works in a similar way to shrinking, if the "invisible"
lines are enough, no new lines are inserted but rather the invisible
buffer is made visible again. Otherwise the amount of lines that still
needs to be inserted is added to the raw buffer, but instead of the
inefficient `Vec::insert`, the `Vec::push` API is used now.
This fixes #1271.
Diffstat (limited to 'src/logging.rs')
0 files changed, 0 insertions, 0 deletions