1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

SystemMonitor: Don't reopen process statistics file on every update

This file can just remain open; we seek to its start anyways.
This previously accounted for over 5% of SystemMonitor runtime.
This commit is contained in:
kleines Filmröllchen 2023-06-24 14:41:13 +02:00 committed by Linus Groh
parent 26d8ac844c
commit 7d53767ce8
2 changed files with 20 additions and 1 deletions

View file

@ -240,6 +240,10 @@ private:
int thread_model_row(Thread const& thread) const;
ErrorOr<void> initialize_process_statistics_file();
OwnPtr<Core::File> m_process_statistics_file;
// The thread list contains the same threads as the Process structs.
HashMap<int, NonnullRefPtr<Thread>> m_threads;
Vector<NonnullOwnPtr<Process>> m_processes;