Commit ca399921 authored by Konstantin Kharlamov's avatar Konstantin Kharlamov

conversation: update GUI every 10 mails

Each call to throttle_loading() takes ≈150..250 ms, which slows down
loading mails a lot. For now let's work around it by calling the
function less times in the cycle.

time foreach took, before 51110.635 ms
time foreach took, after   6577.519 ms
Signed-off-by: Konstantin Kharlamov's avatarKonstantin Kharlamov <>
parent bb8123eb
......@@ -826,6 +826,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
// but keep the scrollbar adjusted so that the first
// interesting message remains visible.
Gtk.Adjustment listbox_adj = get_adjustment();
int i_mail_loaded = 0;
foreach (Geary.Email email in to_insert) {
EmailRow row = add_email(email, false);
// Since uninteresting rows are inserted above the
......@@ -841,7 +842,9 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
loading_height = 0;
yield row.view.load_avatar(this.avatar_store);
yield throttle_loading();
if (i_mail_loaded % 10 == 0)
yield throttle_loading();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment