Enhance performance by updating the GtkTreeModel inside the TaskManager
The code to update the model has been moved inside the XtmTaskManager class and this in order to enhance performance. In fact all the rows of the model were udpdated everytime (150~ processes × 9 columns calls on gtk_list_store_set per seconds) which represented a big CPU hog. Now that the model is being updated within the same class that pulls the processes information it is possible to run low check routines and update only the rows that have updated information. Also big surprise, the new tasks weren't added, well they did but not the right data. The pointer's location was copied instead of the pointer's content.
This commit is contained in:
@@ -66,5 +66,6 @@ const gchar * xtm_task_manager_get_username (XtmTaskManager *manager);
|
||||
const gchar * xtm_task_manager_get_hostname (XtmTaskManager *manager);
|
||||
void xtm_task_manager_get_system_info (XtmTaskManager *manager, guint *num_processes, gfloat *cpu, gfloat *memory, gfloat *swap);
|
||||
const GArray * xtm_task_manager_get_task_list (XtmTaskManager *manager);
|
||||
void xtm_task_manager_update_model (XtmTaskManager *manager);
|
||||
|
||||
#endif /* !TASK_MANAGER_H */
|
||||
|
||||
Reference in New Issue
Block a user