]> Sergey Matveev's repositories - public-inbox.git/commitdiff
*index: discard sync->{todo} on iteration
authorEric Wong <e@80x24.org>
Fri, 13 Nov 2020 11:11:43 +0000 (11:11 +0000)
committerEric Wong <e@80x24.org>
Sun, 15 Nov 2020 06:12:38 +0000 (06:12 +0000)
There's no need to continuously append to {todo} when indexing
multiple inboxes.  They're not redundantly indexed (because the
IdxStack is discarded, making it a noop), but it's still a waste
of memory keeping the $unit hashrefs around.

lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/V2Writable.pm

index 2d230dc18045e5bff145f4e2a0bcb6d513e2178c..6c09c460badb1517f881761e1fd01230762db8cc 100644 (file)
@@ -308,7 +308,7 @@ sub _sync_inbox ($$$) {
                warn "E: $ekey unsupported inbox version (v$v)\n";
                return;
        }
-       index_todo($self, $sync, $_) for @{$sync->{todo}};
+       index_todo($self, $sync, $_) for @{delete($sync->{todo}) // []};
 }
 
 sub eidx_sync { # main entry point
index cf44c95bc8ebfa6aca7d402798a2a9d5f51514fc..11cde627f92b82a98dcade60767b40e073006753 100644 (file)
@@ -1351,7 +1351,7 @@ sub index_sync {
                }
        }
        # work forwards through history
-       index_todo($self, $sync, $_) for @{$sync->{todo}};
+       index_todo($self, $sync, $_) for @{delete($sync->{todo}) // []};
        $self->{oidx}->rethread_done($opt);
        $self->done;