mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-27 20:01:14 +01:00
perf(wm): reduce from sysinfo scan scope
System::new_all() pulls all information (processes, cpu, mem, etc) but we only need process information. In addition currently it is being polled twice. System::new() creates an uninitialized struct, then we poll specifically for process info.
This commit is contained in:
@@ -176,7 +176,7 @@ fn main() -> Result<()> {
|
||||
let session_id = WindowsApi::process_id_to_session_id()?;
|
||||
SESSION_ID.store(session_id, Ordering::SeqCst);
|
||||
|
||||
let mut system = sysinfo::System::new_all();
|
||||
let mut system = sysinfo::System::new();
|
||||
system.refresh_processes(ProcessesToUpdate::All, true);
|
||||
|
||||
let matched_procs: Vec<&Process> = system.processes_by_name("komorebi.exe".as_ref()).collect();
|
||||
|
||||
Reference in New Issue
Block a user