]> Sergey Matveev's repositories - public-inbox.git/commit
v2writable: avoid mm_tmp creation without regen
authorEric Wong <e@80x24.org>
Thu, 30 May 2019 03:59:40 +0000 (03:59 +0000)
committerEric Wong <e@80x24.org>
Thu, 30 May 2019 06:33:35 +0000 (06:33 +0000)
commit6a2805beea98eb52b8ed866758fd2c416e22fdfb
tree5ab5626294dc08771cc2e1792cddfde2e39becc6
parenteb5291e92aa8d9d051948c09e949f705b3178e95
v2writable: avoid mm_tmp creation without regen

Creating mm_tmp is an expensive operation with large inboxes
and can be avoided if there are no new messages to process.

Since git-fetch(1) currently lacks an --exit-code option(*),
mirrors will run `public-inbox-index' unconditionally after
fetch, which is an expensive op if it needs to duplicate
a large SQLite DB.

This speeds up the mirror case of:

git --git-dir=git/$EPOCH.git fetch && public-inbox-index

This reduces the no-op `public-inbox-index' time from over 8s to
~0.5s on a (currently) 7-epoch clone of https://lore.kernel.org/lkml/
on my system.

(*) WIP --exit-code for git-fetch:
    https://public-inbox.org/git/87ftphw7mv.fsf@evledraar.gmail.com/
lib/PublicInbox/V2Writable.pm