pty: increase input buffer size
authorRan Benita <ran234@gmail.com>
Mon, 30 Jan 2012 16:50:28 +0000 (18:50 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 30 Jan 2012 19:51:27 +0000 (20:51 +0100)
commit9d4cd66631336e2025f8b6314e75445ec0176cbb
tree44bf6e7e07f8eccc387121cb414826ec048b93d0
parent9c97408910c1593e19eb92fceea8d92b55fa0c03
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>
src/pty.c