about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-08-02 10:02:54 +0000
committerEric Wong <e@80x24.org>2016-08-04 00:04:53 +0000
commit95acd5901491e4f333f5d2bbeed6fb5e6b53e07c (patch)
treef8e53e9f38ea3710499ca7799936bfd1af352601 /lib/PublicInbox/Mbox.pm
parent4caa17ef5aa8554d78b8c013096f12429c58e050 (diff)
downloadpublic-inbox-95acd5901491e4f333f5d2bbeed6fb5e6b53e07c.tar.gz
Doing git tree lookups based on the SHA-1 of the Message-ID
is expensive as trees get larger, instead, use the SHA-1
object ID directly.  This drastically reduces the amount
of time spent in the "git cat-file --batch" process for
fetching the /$INBOX/all.mbox.gz endpoint on the ~800MB
git@vger.kernel.org mirror

This retains backwards compatibility and allows existing
indices to be transparently upgraded without performance
degradation.
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index d2c09544..1e3de5b0 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -129,7 +129,7 @@ sub getline {
         my $gz = $self->{gz};
         do {
                 while (defined(my $smsg = shift @{$self->{msgs}})) {
-                        my $msg = eval { $ibx->msg_by_mid($smsg->mid) } or next;
+                        my $msg = eval { $ibx->msg_by_smsg($smsg) } or next;
                         $msg = Email::Simple->new($msg);
                         $gz->write(PublicInbox::Mbox::msg_str($ctx, $msg));
                         my $bref = $self->{buf};