After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 579816 - Calendar: extreme slowness adding attendees
Calendar: extreme slowness adding attendees
Status: RESOLVED DUPLICATE of bug 630504
Product: evolution
Classification: Applications
Component: Contacts
2.26.x (obsolete)
Other Linux
: Normal major
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2009-04-22 10:20 UTC by Chenthill P
Modified: 2014-03-10 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Expands the contacts in contact_store rather than using ETreeModelGenerator for better performance (17.99 KB, patch)
2009-04-22 10:23 UTC, Chenthill P
needs-work Details | Review

Description Chenthill P 2009-04-22 10:20:19 UTC
Using my groupwise calendar / addressbook, I create a meeting, select
Attendees, and use the Attendees dialog to add people to it. I search in the
"Novell Groupwise Addressbook" - the second contact I add (or perhaps the
first) - having cleared the search entry, [ or perhaps just typed a single
character ] gives me an application hang for perhaps 5-10 seconds; the trace of
the client while it does this is this:

Thread 1 (Thread 0xb5c30780 (LWP 28166))

  • #0 memmove
    at ../sysdeps/i386/i686/memmove.S line 100
  • #1 IA__g_array_insert_vals
    at /usr/include/bits/string3.h line 59
  • #2 gtk_tree_model_sort_row_inserted
    at gtktreemodelsort.c line 1839
  • #3 _gtk_marshal_VOID__BOXED_BOXED
    at gtkmarshalers.c line 1309
  • #4 IA__g_closure_invoke
    at gclosure.c line 767
  • #5 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #6 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #7 IA__g_signal_emit
    at gsignal.c line 3034
  • #8 IA__gtk_tree_model_row_inserted
    at gtktreemodel.c line 1497
  • #9 row_inserted
    at e-tree-model-generator.c line 279
  • #10 child_row_inserted
    at e-tree-model-generator.c line 689
  • #11 _gtk_marshal_VOID__BOXED_BOXED
    at gtkmarshalers.c line 1309
  • #12 IA__g_closure_invoke
    at gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #14 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #15 IA__g_signal_emit
    at gsignal.c line 3034
  • #16 IA__gtk_tree_model_row_inserted
    at gtktreemodel.c line 1497
  • #17 row_inserted
    at e-contact-store.c line 230
  • #18 view_sequence_complete
    at e-contact-store.c line 633
  • #19 IA__g_cclosure_marshal_VOID__INT
    at gmarshal.c line 216
  • #20 IA__g_closure_invoke
    at gclosure.c line 767
  • #21 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #22 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #23 IA__g_signal_emit
    at gsignal.c line 3034
  • #24 e_book_view_handle_response
    at e-book-view.c line 69
  • #25 IA__g_cclosure_marshal_VOID__POINTER
    at gmarshal.c line 601
  • #26 IA__g_closure_invoke
    at gclosure.c line 767
  • #27 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #28 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #29 IA__g_signal_emit
    at gsignal.c line 3034
  • #30 main_thread_get_response
    at e-book-view-listener.c line 69
  • #31 g_child_watch_dispatch
    at gmain.c line 3952
  • #32 IA__g_main_context_dispatch
    at gmain.c line 2173
  • #33 g_main_context_iterate
    at gmain.c line 2728
  • #34 IA__g_main_loop_run
    at gmain.c line 2995
  • #35 bonobo_main
    at bonobo-main.c line 311
  • #36 main
    at main.c line 689
  • #17 row_inserted
    at e-contact-store.c line 230
225
226             path = gtk_tree_path_new ();
227             gtk_tree_path_append_index (path, n);
228
229             if (gtk_tree_model_get_iter (GTK_TREE_MODEL (contact_store),
&iter, path))
230                     gtk_tree_model_row_inserted (GTK_TREE_MODEL
(contact_store), path, &iter);
231
232             gtk_tree_path_free (path);
233     }
234
(gdb) finish
Run till exit from #17 0xb7a0ac84 in row_inserted (contact_store=0x9eb06b0,
n=<value optimized out>) at e-contact-store.c:230
[Thread 0xa70f6b90 (LWP 2274) exited]
view_sequence_complete (contact_store=0x9eb06b0, status=E_BOOK_VIEW_STATUS_OK,
book_view=0x9748100) at e-contact-store.c:624
624             for (i = 0; i < source->contacts_pending->len; i++) {
(gdb) p source->contacts_pending
$1 = (GPtrArray *) 0xa2e93560
(gdb) p source->contacts_pending->len
$2 = 13406


This are quite a lot (13k) of contacts to be adding & sorting I guess - but
clearly we are doing something silly - it should be ~instant to sort that many
people; looks like some N^2 crept into there (?)

Downstream bug id - https://bugzilla.novell.com/show_bug.cgi?id=476133.
Comment 1 Chenthill P 2009-04-22 10:23:15 UTC
Created attachment 133100 [details] [review]
Expands the contacts in contact_store rather than using ETreeModelGenerator for better performance

This patch reduces the time required to load ENameSelectorDialog from 7 seconds to 3 seconds for loading around 11k contacts.
Comment 2 Milan Crha 2009-10-15 13:35:26 UTC
Patch looks good, just please:
- do not add an empty line where not needed (see view_sequence_complete)
- consider also removing the model from a tree view (if possible), as any
  change is probably calling other rutines/signals in a tree view. I noticed
  the slowness when I was trying to see the state of GtkTreeView as
  a replacement of ETree/ETable, and detaching it from TreeView before any mass
  operations and attaching back after done with it, did a good job in
  performance
- fix also this, please
> (get_email_count (cached_contact) == get_email_count (contact)) == 1))
- use if (!priv->expand_contacts) { in view_sequence_complete instead of
  if (!priv->expand_contacts)\n{

As the patch is quite large, commit the modified version to master only, where will be done other tests after that.
Comment 3 Milan Crha 2010-04-01 14:46:58 UTC
Comment on attachment 133100 [details] [review]
Expands the contacts in contact_store rather than using ETreeModelGenerator for better performance

We are almost a year later, please update the patch.
Comment 4 Chenthill P 2011-03-14 13:24:51 UTC
I have missed this completely. Will take it up post Evolution 3.0.
Comment 5 Milan Crha 2014-03-10 17:50:23 UTC
The issue is better discussed in bug #630504, with another approach (server-side sorting), thus I mark this as a duplicate of it.

*** This bug has been marked as a duplicate of bug 630504 ***