pgo: feed VT data through fdm_ptmx(), not vt_from_slave()

fdm_ptmx(), the FDM callback handler for ptmx data, is just as much in
the hot path as vt_from_slave(). It is also slightly more complicated
than a read() followed by a call to vt_from_slave().

As a result, some benchmarks performed significantly worse in a
partial PGO build than in a full PGO build, since fdm_ptmx() wasn’t
PGO:d.

To be able to feed data through fdm_ptmx(), we need to set up the
delayed rendering timer FDs, configure the timeout values, and provide
a readable FD it can read the VT data from.

The latter is done with a memory FD. This ensures *all* VT data is
loaded into memory before we feed it to the parser.
This commit is contained in:
Daniel Eklöf 2020-11-21 13:25:56 +01:00
parent ecaa3b4135
commit daa8d129c1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 64 additions and 7 deletions

View file

@ -198,7 +198,9 @@ fdm_ptmx_out(struct fdm *fdm, int fd, int events, void *data)
static struct timespec last = {0};
#endif
static bool
/* Externally visible, but not declared in terminal.h, to enable pgo
* to call this function directly */
bool
fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
{
struct terminal *term = data;