1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 07:46:59 +03:00
wezterm/wezterm-ssh/src
Wez Furlong 33f25e9ce6
reduce latency when heavily using foreground process info
The tcgetpgrp call appears to have high variance in latency, ranging
from 200-700us on my system.

If you have 10 tabs and mouse over the tab bar, that's around 7ms
spent per frame just figuring out the foreground process; that doesn't
include actually extracting the process executable or current working
directory paths.

This was exacerbated by the mouse move events triggering a tab bar
recompute on every pixel of mouse movement.

This commit takes the following steps to resolve this:

* We now only re-compute the tab bar when the UI item is changed by
  a mouse movement
* A simple single-item cache is now used on unix that allows the caller
  to proceed quickly with stale-but-probably-still-mostly-accurate data
  while queuing up an update to a background thread which can absorb
  the latency.

The result of this is that hovering over several tabs in quick
succession no longer takes a noticeable length of time to render the
hover, but the consequence is that the contents of a given tab may be
stale by 300-400ms.

I think that trade-off is worth while.

We already have a similar trade-off on Windows, although we don't
yet do the updates in a different thread on Windows. Perhaps in
a follow up commit?

refs: https://github.com/wez/wezterm/issues/2991
2023-01-21 15:25:57 -07:00
..
sftp encoding my preferred import grouping in the rustfmt config 2022-01-17 13:50:51 -07:00
auth.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
channelwrap.rs pty: ExitStatus now understands signals and impl Display 2022-04-09 06:15:54 -07:00
config.rs ssh: correctly expand %h tokens in ssh config 2022-08-23 10:32:07 -07:00
dirwrap.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
filewrap.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
host.rs update base64, work around another batch of breaking API changes 2023-01-08 18:49:45 -07:00
lib.rs Re-export portable_pty::{PtySize, MasterPty, ChildKiller} as it is available in public API (#1603) 2022-01-30 18:27:29 -07:00
pty.rs reduce latency when heavily using foreground process info 2023-01-21 15:25:57 -07:00
session.rs ssh: reduce some redundant logging around AcceptEnv 2022-08-31 20:40:06 -07:00
sessioninner.rs ssh: respect AddressFamily for environments with broken ipv6 2022-12-26 16:18:18 -07:00
sessionwrap.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
sftpwrap.rs Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00