diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-02-18 11:06:34 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-02-21 20:42:07 -0500 |
commit | 0dfa824f55e53809b10c8e2831ac387ee33a6ec7 (patch) | |
tree | 07b27c05438305eea4861097019a1be87617b0a2 | |
parent | 254d95492c0a322594d9f50e5d3774d4ece5a4d7 (diff) |
trace-view: Do less gtk_main_iteration_do() in search
To speed up the search function slightly, only call the gtk_main_iteration_do()
every 32 iterations.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-view.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/trace-view.c b/trace-view.c index 0ce730c..8151120 100644 --- a/trace-view.c +++ b/trace-view.c | |||
@@ -744,7 +744,7 @@ static void search_next_pages(GtkTreeView *tree, | |||
744 | for (; row < total_rows; row++) { | 744 | for (; row < total_rows; row++) { |
745 | 745 | ||
746 | /* Needed to process the cursor change */ | 746 | /* Needed to process the cursor change */ |
747 | if (row & (1 << 5)) | 747 | if (!(row & ((1 << 5)-1))) |
748 | gtk_main_iteration_do(FALSE); | 748 | gtk_main_iteration_do(FALSE); |
749 | 749 | ||
750 | rec = trace_view_store_get_actual_row(store, row); | 750 | rec = trace_view_store_get_actual_row(store, row); |
@@ -782,6 +782,7 @@ static void search_tree(gpointer data) | |||
782 | gint search_val; | 782 | gint search_val; |
783 | gint start_row; | 783 | gint start_row; |
784 | gboolean found = FALSE; | 784 | gboolean found = FALSE; |
785 | gint i = 0; | ||
785 | 786 | ||
786 | col_num = gtk_combo_box_get_active(col_combo); | 787 | col_num = gtk_combo_box_get_active(col_combo); |
787 | sel = gtk_combo_box_get_active(sel_combo); | 788 | sel = gtk_combo_box_get_active(sel_combo); |
@@ -822,9 +823,9 @@ static void search_tree(gpointer data) | |||
822 | 823 | ||
823 | search_val = atoi(search_text); | 824 | search_val = atoi(search_text); |
824 | while (gtk_tree_model_iter_next(model, &iter)) { | 825 | while (gtk_tree_model_iter_next(model, &iter)) { |
825 | |||
826 | /* Needed to process the cursor change */ | 826 | /* Needed to process the cursor change */ |
827 | gtk_main_iteration_do(FALSE); | 827 | if (!(i++ & ((1 << 5)-1))) |
828 | gtk_main_iteration_do(FALSE); | ||
828 | 829 | ||
829 | found = test_row(model, &iter, sel, col_num, search_val, search_text); | 830 | found = test_row(model, &iter, sel, col_num, search_val, search_text); |
830 | if (found) | 831 | if (found) |