Skip to content

Commit

Permalink
lib-storage: Optimize error handling for SORT
Browse files Browse the repository at this point in the history
If a lot of mails have failed in a large mailbox, this check reduces the
CPU usage significantly.
  • Loading branch information
sirainen authored and villesavolainen committed Jun 9, 2017
1 parent 521d502 commit 5954998
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib-storage/index/index-sort-string.c
Expand Up @@ -355,6 +355,11 @@ index_sort_get_string(struct sort_string_context *ctx,
uint32_t seq = node->seq;
int ret = 1;

if (node->no_update) {
/* we've already determined that we can't do this lookup */
return FALSE;
}

if (ctx->sort_strings[seq] == NULL) T_BEGIN {
string_t *str;
const char *result;
Expand Down

0 comments on commit 5954998

Please sign in to comment.