diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2013-05-24 22:46:01 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-05-24 22:46:01 +0000 |
commit | 6cfa9e0bf2ded1add3f018986268d9b1c3b119b6 (patch) | |
tree | eef7e35c7002f1e375fdd671380c3f1e8b9b839a /Settings.c | |
parent | 5c2d84aba37e79a2a07cf846c340c0e3d74695f0 (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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++; } } |