[commit] master: make use of finduid[] after journal replay
mailbox synchronizer
Brought to you by:
ossi
|
From: Oswald B. <os...@us...> - 2022-06-19 14:37:41
|
commit 8f4af5f78f118f2e508ca1af7e30d20a3dae8cae
Author: Oswald Buddenhagen <os...@us...>
Date: Wed Dec 29 22:38:50 2021 +0100
make use of finduid[] after journal replay
we used to pass all initially loaded messages to match_tuids(), which
could be quite some when syncing old messages. as lost TUIDs result in
O(n^2) behavior, this could have a serious performance impact.
src/sync.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/sync.c b/src/sync.c
index 62c48a63..d0dd0561 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -842,6 +842,7 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux
if (svars->state[t] & ST_FIND_OLD) {
debug( "matching previously copied messages on %s\n", str_fn[t] );
+ for (; msgs && msgs->uid < svars->finduid[t]; msgs = msgs->next) {}
match_tuids( svars, t, msgs );
}
|