summaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorDenis Lisov <dennis.lissov@gmail.com>2021-12-16 18:36:01 +0300
committerBenBE <BenBE@geshi.org>2022-02-13 19:50:16 +0100
commit82dce5cf8e241a46d4c9eae23423c63c5d1f17d2 (patch)
tree55d723f2dadcca07f088a7b2572f0a9c0b506a7d /Process.h
parent8d987864e49653a477026b829f79f4d7c8e3bccd (diff)
ProcessList_buildTree: sort by parent for fast search
ProcessList_buildTreeBranch used to search for children with a linear scan of the process table, which made tree build time quadratic in process count. Pre-sorting the list by parent PID (if known) makes it possible to select the correct slice by bisection much faster.
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Process.h b/Process.h
index d6a1f996..c2eb84be 100644
--- a/Process.h
+++ b/Process.h
@@ -255,6 +255,9 @@ typedef struct Process_ {
unsigned int tree_depth;
unsigned int tree_index;
+ /* Has no known parent process */
+ bool isRoot;
+
/*
* Internal state for merged Command display
*/

© 2014-2024 Faster IT GmbH | imprint | privacy policy