diff options
author | Denis Lisov <dennis.lissov@gmail.com> | 2021-12-16 18:36:01 +0300 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2022-02-13 19:50:16 +0100 |
commit | 82dce5cf8e241a46d4c9eae23423c63c5d1f17d2 (patch) | |
tree | 55d723f2dadcca07f088a7b2572f0a9c0b506a7d /Process.h | |
parent | 8d987864e49653a477026b829f79f4d7c8e3bccd (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.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 */ |