mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-12 08:02:40 +02: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()?;
|
let session_id = WindowsApi::process_id_to_session_id()?;
|
||||||
SESSION_ID.store(session_id, Ordering::SeqCst);
|
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);
|
system.refresh_processes(ProcessesToUpdate::All, true);
|
||||||
|
|
||||||
let matched_procs: Vec<&Process> = system.processes_by_name("komorebi.exe".as_ref()).collect();
|
let matched_procs: Vec<&Process> = system.processes_by_name("komorebi.exe".as_ref()).collect();
|
||||||
|
|||||||
Reference in New Issue
Block a user