From a28353eb761ec35cce38a71f20917d4bf4ff94c8 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 25 Aug 2023 12:42:59 -0700 Subject: [PATCH] sysprof: sort callgraph models incrementally This represented a large stall when loading the window, and also results in doing a bunch of work twice as we set the model (then again the time range). So instead, just do it incrementally and let the functions list backfill in a bit. --- src/sysprof/sysprof-callgraph-view.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sysprof/sysprof-callgraph-view.c b/src/sysprof/sysprof-callgraph-view.c index 1377bd54..58b3d6c2 100644 --- a/src/sysprof/sysprof-callgraph-view.c +++ b/src/sysprof/sysprof-callgraph-view.c @@ -104,6 +104,7 @@ sysprof_callgraph_view_set_descendants (SysprofCallgraphView *self, descendants_sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter)); descendants_sort_model = gtk_sort_list_model_new (g_object_ref (G_LIST_MODEL (descendants_tree)), g_object_ref (GTK_SORTER (descendants_sorter))); + gtk_sort_list_model_set_incremental (descendants_sort_model, TRUE); descendants_selection = gtk_single_selection_new (g_object_ref (G_LIST_MODEL (descendants_sort_model))); gtk_single_selection_set_autoselect (descendants_selection, FALSE); g_signal_connect_object (descendants_selection, @@ -631,6 +632,7 @@ sysprof_callgraph_view_reload_cb (GObject *object, gtk_filter_list_model_set_incremental (filter_model, TRUE); functions_sort_model = gtk_sort_list_model_new (g_object_ref (G_LIST_MODEL (filter_model)), g_object_ref (column_sorter)); + gtk_sort_list_model_set_incremental (functions_sort_model, TRUE); functions_selection = gtk_single_selection_new (g_object_ref (G_LIST_MODEL (functions_sort_model))); gtk_single_selection_set_autoselect (functions_selection, FALSE); gtk_single_selection_set_can_unselect (functions_selection, TRUE);