diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-07-19 23:12:28 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-20 11:55:42 +0430 |
commit | 31840866798a1e369e9824689c46d9e7ee0e7dbd (patch) | |
tree | 71a9c0c78068fc9029adea9aba438f93a2803faa /Userland/Libraries/LibLine/VT.h | |
parent | 0f6654fef289421bafaacbae1aa5c04bf8292bd8 (diff) | |
download | serenity-31840866798a1e369e9824689c46d9e7ee0e7dbd.zip |
LibLine: Avoid excessive write() syscalls when refreshing the display
Previously, we were generating the display update one character at a
time, and writing them one at a time to stderr, which is not buffered,
doing so caused one syscall per character printed which is s l o w (TM)
This commit makes LibLine write the update contents into a buffer, and
flush it after all the update is generated :^)
Diffstat (limited to 'Userland/Libraries/LibLine/VT.h')
-rw-r--r-- | Userland/Libraries/LibLine/VT.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibLine/VT.h b/Userland/Libraries/LibLine/VT.h index 681edf0353..da5332dc29 100644 --- a/Userland/Libraries/LibLine/VT.h +++ b/Userland/Libraries/LibLine/VT.h @@ -12,13 +12,13 @@ namespace Line { namespace VT { -void save_cursor(); -void restore_cursor(); -void clear_to_end_of_line(); -void clear_lines(size_t count_above, size_t count_below = 0); -void move_relative(int x, int y); -void move_absolute(u32 x, u32 y); -void apply_style(const Style&, bool is_starting = true); +void save_cursor(OutputStream&); +void restore_cursor(OutputStream&); +void clear_to_end_of_line(OutputStream&); +void clear_lines(size_t count_above, size_t count_below, OutputStream&); +void move_relative(int x, int y, OutputStream&); +void move_absolute(u32 x, u32 y, OutputStream&); +void apply_style(const Style&, OutputStream&, bool is_starting = true); } } |