pty: increase input buffer size
Increase the buffer size to match the kernel's. This should guarantee
(practically) that we read() everything queued up for us.
This speeds us up considerably when running something like
$ find /
Such a process spends most of its time blocking on write() waiting for
us. By increasing the buffer size we avoid repeated
read pty -> draw screen -> read pty
cycles, which take most of our time.
To time it, before:
real 0m22.588s
user 0m00.000s
sys 0m00.020s
After:
real 0m00.680s
user 0m00.023s
sys 0m00.000s
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>