aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-21 12:25:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-11-22 18:29:44 +0000
commitdaa8d129c1b9d089aa622c0874f9d1a8c8b9cc6d (patch)
tree1ac505413dddbcc0b0984657d47eeb96ddb4d6e2 /terminal.c
parentrender: no need to call attrs_to_font(), we already have a font reference (diff)
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.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/terminal.c b/terminal.c
index 2c5e0a85..f78e103c 100644
--- a/terminal.c
+++ b/terminal.c
@@ -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;