mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user