Re: [dev] [st] Removing timeouts in main loop

From: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
Date: Sun, 16 Sep 2012 11:51:06 +0200

On Sun, Sep 16, 2012 at 9:47 AM, Roberto E. Vargas Caballero
<k0ga_AT_shike2.com> wrote:
> This serie of patches try fix the problem of the timeout in main loop, which
> causes st wakeup each 20 ms even thare is noting to do.

The timeout "problem" was introduced to speed up the rendering when a
lot of text is printed.
The logic is basically to not redraw on every read when the throughput is high:
- try to read data for SELECT_TIMEOUT ms max
- if something was read, handle it in the term
- if something was read and the last call to draw was more than
DRAW_TIMEOUT ms ago then redraw.

I don't have a unix machine at the moment but here is a simple testcase:

    $ dd if=/dev/random bs=4K count=100 | hexdump

Increase the count and compare with other terms if necessary.
Received on Sun Sep 16 2012 - 11:51:06 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 16 2012 - 12:00:05 CEST