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 630504 - Slow sort of contacts in the ENameSelectorDialog
Slow sort of contacts in the ENameSelectorDialog
Status: RESOLVED INCOMPLETE
Product: evolution
Classification: Applications
Component: Contacts
3.8.x (obsolete)
Other Linux
: Normal major
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
: 579816 666848 705706 709321 711212 764682 767644 (view as bug list)
Depends on: 705178 774494
Blocks:
 
 
Reported: 2010-09-24 09:56 UTC by Akhil Laddha
Modified: 2020-07-02 07:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
proposed eds patch (9.09 KB, patch)
2010-10-15 13:44 UTC, Milan Crha
rejected Details | Review
evo patch (10.46 KB, patch)
2010-10-20 08:15 UTC, Milan Crha
committed Details | Review
proposed eds patch ][ (7.18 KB, patch)
2010-10-22 12:49 UTC, Milan Crha
reviewed Details | Review

Description Akhil Laddha 2010-09-24 09:56:45 UTC
evolution 2.33.1

Open New -> Meeting, evolution UI hangs for a while. Same thing happens when i try to look for free/busy. I have an address book from 'On this computer' selected in contact view and it has around 4800 contacts. If i change address book selection to something else like address book with 160 contact, UI doesn't hang.

gdb traces of evolution when UI hangs

Program received signal SIGINT, Interrupt.
generated_offset_to_child_offset (group=0xd8f8330, offset=12993, internal_offset=0xbfffd45c) at e-tree-model-generator.c:303
303		for (i = 0; i < group->len; i++) {
(gdb) bt
  • #0 generated_offset_to_child_offset
    at e-tree-model-generator.c line 303
  • #1 e_tree_model_generator_convert_iter_to_child_iter
    at e-tree-model-generator.c line 960
  • #2 e_tree_model_generator_get_value
    at e-tree-model-generator.c line 1302
  • #3 IA__gtk_tree_model_get_value
    at gtktreemodel.c line 1147
  • #4 _gtk_tree_data_list_compare_func
    at gtktreedatalist.c line 319
  • #5 gtk_tree_model_sort_level_find_insert
    at gtktreemodelsort.c line 1818
  • #6 gtk_tree_model_sort_insert_value
    at gtktreemodelsort.c line 1863
  • #7 gtk_tree_model_sort_row_inserted
    at gtktreemodelsort.c line 674
  • #8 _gtk_marshal_VOID__BOXED_BOXED
    at gtkmarshalers.c line 1309
  • #9 g_closure_invoke
    at gclosure.c line 766
  • #10 signal_emit_unlocked_R
    at gsignal.c line 3252
  • #11 g_signal_emit_valist
    at gsignal.c line 2983
  • #12 g_signal_emit
    at gsignal.c line 3040
  • #13 IA__gtk_tree_model_row_inserted
    at gtktreemodel.c line 1501
  • #14 row_inserted
    at e-tree-model-generator.c line 271
  • #15 child_row_inserted
    at e-tree-model-generator.c line 678
  • #16 _gtk_marshal_VOID__BOXED_BOXED
    at gtkmarshalers.c line 1309
  • #17 g_closure_invoke
    at gclosure.c line 766
  • #18 signal_emit_unlocked_R
    at gsignal.c line 3252
  • #19 g_signal_emit_valist
    at gsignal.c line 2983
  • #20 g_signal_emit
    at gsignal.c line 3040
  • #21 IA__gtk_tree_model_row_inserted
    at gtktreemodel.c line 1501
  • #22 row_inserted
    at e-contact-store.c line 226
  • #23 view_contacts_added
    at e-contact-store.c line 522
  • #24 g_cclosure_marshal_VOID__POINTER
    at gmarshal.c line 603
  • #25 g_closure_invoke
    at gclosure.c line 766
  • #26 signal_emit_unlocked_R
    at gsignal.c line 3252
  • #27 g_signal_emit_valist
    at gsignal.c line 2983
  • #28 g_signal_emit
    at gsignal.c line 3040
  • #29 contacts_added_cb
    at e-book-view.c line 71
  • #30 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 568
  • #31 g_closure_invoke
    at gclosure.c line 766
  • #32 signal_emit_unlocked_R
    at gsignal.c line 3252
  • #33 g_signal_emit_valist
    at gsignal.c line 2983
  • #34 g_signal_emit
    at gsignal.c line 3040
  • #35 g_signal
    at e-gdbus-egdbusbookview.c line 1553
  • #36 _gio_marshal_VOID__STRING_STRING_VARIANT
    at gio-marshal.c line 775
  • #37 g_type_class_meta_marshal
    at gclosure.c line 877
  • #38 g_closure_invoke
    at gclosure.c line 766
  • #39 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #40 g_signal_emit_valist
    at gsignal.c line 2983
  • #41 g_signal_emit
    at gsignal.c line 3040
  • #42 on_signal_received
    at gdbusproxy.c line 754
  • #43 emit_signal_instance_in_idle_cb
    at gdbusconnection.c line 3382
  • #44 g_idle_dispatch
    at gmain.c line 4254
  • #45 g_main_dispatch
    at gmain.c line 2149
  • #46 g_main_context_dispatch
    at gmain.c line 2702
  • #47 g_main_context_iterate
    at gmain.c line 2780
  • #48 g_main_loop_run
    at gmain.c line 2988
  • #49 IA__gtk_main
    at gtkmain.c line 1219
  • #50 main
    at main.c line 671

Comment 1 Matthew Barnes 2010-09-24 12:36:59 UTC
Is it a busy loop?  Is your CPU pegged while the UI is hung?
Comment 2 Akhil Laddha 2010-09-27 04:03:57 UTC
Evolution eats 100% cpu for close to a minute when UI hangs.
Comment 3 Milan Crha 2010-10-15 13:44:15 UTC
Created attachment 172421 [details] [review]
proposed eds patch

for evolution-data-server;

Please give a try to this patch. I've generated a test address book with 6000 simple contacts and with this patch I'm able to get to a bit less than 1/2 time from the eds without it, though it still freezes for about 3 seconds. It seems that the other bottleneck is vCard parsing, because there it seems to stuck for me now. It's about the same time (and CPU usage) like when I open the address book in evolution itself, in contacts view, for the first time.

Thread 1 (Thread 0xb77db850 (LWP 18444))

  • #0 g_string_insert_unichar
    at gstring.c line 1150
  • #1 g_string_append_unichar
    at gstring.c line 921
  • #2 read_attribute_value
    at e-vcard.c line 282
  • #3 read_attribute
    at e-vcard.c line 546
  • #4 parse
    at e-vcard.c line 632
  • #5 e_vcard_construct
    at e-vcard.c line 752
  • #6 e_contact_new_from_vcard
    at e-contact.c line 1223
  • #7 contacts_added_cb
    at e-book-view.c line 66

Comment 4 Milan Crha 2010-10-20 08:15:31 UTC
Created attachment 172793 [details] [review]
evo patch

for evolution;

Maybe this will speed up address book loading in Contacts view a bit for you?
Comment 5 Akhil Laddha 2010-10-20 10:15:07 UTC
This patch seems to improve the performance.
Comment 6 Akhil Laddha 2010-10-20 10:24:44 UTC
I am not sure if this bug is already there or a side effect but i don't see count update in status bar while address book is getting loaded, instead it says 'loading...' only.
Comment 7 Milan Crha 2010-10-20 10:55:14 UTC
(In reply to comment #6)
> I am not sure if this bug is already there or a side effect but i don't see
> count update in status bar while address book is getting loaded, instead it
> says 'loading...' only.

Hmm, I do not know, I asked Matt in just filled bug #632676
Comment 8 Milan Crha 2010-10-20 11:06:46 UTC
Per comment #5 I'm rejecting the eds patch and committing the evo patch to master only - for more testing.
Comment 9 Milan Crha 2010-10-20 11:36:38 UTC
Created commit 7a07c80 in evo master (2.91.2+)
Comment 10 Akhil Laddha 2010-10-20 12:04:12 UTC
Patch doesn't solve the actual problem mentioned in initial bug description so we need more efforts to fix the bug properly.
Comment 11 Milan Crha 2010-10-20 13:58:37 UTC
Confirming, my fault. I'm sorry for that.
Comment 12 Milan Crha 2010-10-22 12:49:53 UTC
Created attachment 172997 [details] [review]
proposed eds patch ][

for evolution-data-server;

Could you give a try to this patch, please? I do not see much difference, but your addressbook is obviously different from that mine. Though if this will not help, then nothing. I'm getting out of idea here. :-/
Comment 13 Akhil Laddha 2011-02-02 05:36:43 UTC
Sorry but patch attached in comment#12 doesn't seem to solve the problem. 
If it helps, i can send you vcf file of address book where i notice the problem.
Comment 14 Milan Crha 2011-02-08 18:07:57 UTC
I tried with your test address book you sent me by email and even I cannot reproduce "hang on New->Meeting" then selecting the book in "Attendees" freezes UI for few seconds and CPU usage is high (without the above patch on actual git master as of today). I'll check more deeply when I get to this later.
Comment 15 Milan Crha 2013-09-04 15:11:00 UTC
I see the issue now, the trick is to pick a sufficiently large book in the ENameSelectorDialog (like the one which is under the "To" button in a composer). I have one with 20K contacts, and it takes quite long time to be sorted in the list, due to slow sort of GtkTreeModelSort object.
Comment 16 Milan Crha 2013-09-13 07:49:21 UTC
Once the Tristan's work land, one of the first usages might be here, in the name selector dialog.
Comment 17 Milan Crha 2014-03-10 17:47:48 UTC
*** Bug 711212 has been marked as a duplicate of this bug. ***
Comment 18 Milan Crha 2014-03-10 17:48:23 UTC
*** Bug 705706 has been marked as a duplicate of this bug. ***
Comment 19 Milan Crha 2014-03-10 17:50:23 UTC
*** Bug 579816 has been marked as a duplicate of this bug. ***
Comment 20 Milan Crha 2015-04-09 14:50:02 UTC
*** Bug 709321 has been marked as a duplicate of this bug. ***
Comment 21 Milan Crha 2016-04-06 09:54:07 UTC
*** Bug 666848 has been marked as a duplicate of this bug. ***
Comment 22 Milan Crha 2016-04-06 17:28:50 UTC
*** Bug 764682 has been marked as a duplicate of this bug. ***
Comment 23 Milan Crha 2016-06-14 13:36:24 UTC
*** Bug 767644 has been marked as a duplicate of this bug. ***
Comment 24 Milan Crha 2020-07-02 07:59:25 UTC
A similar bug had been filled in the GNOME GitLab instance [1], thus I close this in a favor of the other one.

[1] https://gitlab.gnome.org/GNOME/evolution/-/issues/1015