summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-05-24 22:46:01 +0000
committerHisham Muhammad <hisham@gobolinux.org>2013-05-24 22:46:01 +0000
commit6cfa9e0bf2ded1add3f018986268d9b1c3b119b6 (patch)
treeeef7e35c7002f1e375fdd671380c3f1e8b9b839a /Settings.c
parent5c2d84aba37e79a2a07cf846c340c0e3d74695f0 (diff)
Performance improvements due to conditional parsing of IO data depending on selected fields.
On my machine, this gives a ~20% improvement in htop process time use with the default config.
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Settings.c b/Settings.c
index fd200a7c..46b3a971 100644
--- a/Settings.c
+++ b/Settings.c
@@ -82,11 +82,13 @@ static bool Settings_read(Settings* this, char* fileName, int cpuCount) {
char** ids = String_split(trim, ' ', &nIds);
free(trim);
int i, j;
+ this->pl->flags = 0;
for (j = 0, i = 0; i < LAST_PROCESSFIELD && ids[i]; i++) {
// This "+1" is for compatibility with the older enum format.
int id = atoi(ids[i]) + 1;
if (id > 0 && id < LAST_PROCESSFIELD) {
this->pl->fields[j] = id;
+ this->pl->flags |= Process_fieldFlags[id];
j++;
}
}

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