aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Shin <edshin95@gmail.com>2024-07-19 10:13:16 -0400
committerGitHub <noreply@github.com>2024-07-19 16:13:16 +0200
commitb4f176facd55eeb1e5acf34f2337a68004bb802b (patch)
tree9dbb6d1d135ddaf07aefd6f9aa86fc2ab33dd4ec
parentdocs(changelog): startup delay fix (diff)
downloadsl0ppij-b4f176facd55eeb1e5acf34f2337a68004bb802b.tar.gz
sl0ppij-b4f176facd55eeb1e5acf34f2337a68004bb802b.tar.xz
sl0ppij-b4f176facd55eeb1e5acf34f2337a68004bb802b.zip
fix(terminal): only refresh process specifics for given PID in get_cwd() (#3472)
Update `get_cwd()` to only refresh process specifics for the given PID, matching the `get_cwds()` implementation. This significantly reduces the latency of opening a new Pane or Tab. On a 64-core Threadripper system, this reduces the latency of `get_cwd()` from 850ms to 1ms. On an 8-core Ryzen system, the improvement is smaller, but still perceptible.
-rw-r--r--zellij-server/src/os_input_output.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs
index 640b6fbc..426d3485 100644
--- a/zellij-server/src/os_input_output.rs
+++ b/zellij-server/src/os_input_output.rs
@@ -740,7 +740,7 @@ impl ServerOsApi for ServerOsInputOutput {
let mut system_info = System::new();
// Update by minimizing information.
// See https://docs.rs/sysinfo/0.22.5/sysinfo/struct.ProcessRefreshKind.html#
- system_info.refresh_processes_specifics(ProcessRefreshKind::default());
+ system_info.refresh_process_specifics(pid.into(), ProcessRefreshKind::default());
if let Some(process) = system_info.process(pid.into()) {
let cwd = process.cwd();