We don't need to use git to check ancestry if object IDs
match on a string comparison.
This saves 100ms or so and brings down the ~0.5s no-op time on
lore.kernel.org/lkml down to ~0.4s.
---
lib/PublicInbox/V2Writable.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index fd93ac2..76844cd 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -831,6 +831,12 @@ sub log_range ($$$$$) {
return $tip; # all of it
};
+ # fast equality check to avoid (v)fork+execve overhead
+ if ($cur eq $tip) {
+ $sync->{ranges}->[$i] = undef;
+ return;
+ }
+
my $range = "$cur..$tip";
$pr->("$i.git checking contiguity... ") if $pr;
if (is_ancestor($git, $cur, $tip)) { # common case
--
EW
--
unsubscribe: [email protected]
archive: https://public-inbox.org/meta/