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.
This commit is contained in:
parent
591722a5d8
commit
b4f176facd
1 changed files with 1 additions and 1 deletions
|
|
@ -740,7 +740,7 @@ impl ServerOsApi for ServerOsInputOutput {
|
||||||
let mut system_info = System::new();
|
let mut system_info = System::new();
|
||||||
// Update by minimizing information.
|
// Update by minimizing information.
|
||||||
// See https://docs.rs/sysinfo/0.22.5/sysinfo/struct.ProcessRefreshKind.html#
|
// 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()) {
|
if let Some(process) = system_info.process(pid.into()) {
|
||||||
let cwd = process.cwd();
|
let cwd = process.cwd();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue