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 /ColumnsPanel.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 'ColumnsPanel.c')
-rw-r--r-- | ColumnsPanel.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ColumnsPanel.c b/ColumnsPanel.c index 639d5e6d..f4eed99e 100644 --- a/ColumnsPanel.c +++ b/ColumnsPanel.c @@ -122,11 +122,14 @@ void ColumnsPanel_update(Panel* super) { // FIXME: this is crappily inefficient free(this->settings->pl->fields); this->settings->pl->fields = (ProcessField*) malloc(sizeof(ProcessField) * (size+1)); + this->settings->pl->flags = 0; for (int i = 0; i < size; i++) { char* text = ((ListItem*) Panel_get(super, i))->value; int j = ColumnsPanel_fieldNameToIndex(text); - if (j > 0) + if (j > 0) { this->settings->pl->fields[i] = j; + this->settings->pl->flags |= Process_fieldFlags[j]; + } } this->settings->pl->fields[size] = 0; } |