It appears the Perl split() operator is not optimized for fixed
strings at all. With this change, PublicInbox::Config->new (w/o
->fill_all) time is reduced from 1.81s to 1.22s on a config file
with 50K inboxes.
return {} unless -e $file;
my $cmd = [ qw(git config -z -l --includes), "--file=$file" ];
my $fh = popen_rd($cmd);
- my $rv = config_fh_parse($fh, "\0", "\n");
+ my $rv = config_fh_parse($fh, "\0", qr/\n/);
close $fh or die "failed to close (@$cmd) pipe: $?";
$rv;
}