From: Alan Cox Date: Sat, 18 Aug 2018 19:34:16 +0000 (+0100) Subject: tty: note an optimization area X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=f8164c5c83b0b16c2841d0dd8b8f0e54480014a0;p=FUZIX.git tty: note an optimization area --- diff --git a/Kernel/tty.c b/Kernel/tty.c index eba4444f..1116c4b1 100644 --- a/Kernel/tty.c +++ b/Kernel/tty.c @@ -123,6 +123,15 @@ int tty_write(uint8_t minor, uint8_t rawflag, uint8_t flag) if (psleep_flags_io(&t->flag, flag)) return udata.u_done; } + /* We could optimize this significantly by + a) looping here if not sleeping rather than repeating all + the checks except for STOP/DISCARD + b) possibly batching for the case where tty never blocks + if we have a way to report that. We could then batch except + for conversions and also fast path in vt for 'normal char + next char normal' + c) look at hint/batching for ugetc into a local work buffer + */ if (!(t->flag & TTYF_DISCARD)) { if (udata.u_sysio) c = *udata.u_base;