aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2018-06-01 00:16:27 +0100
committerSteve McIntyre <steve@einval.com>2018-06-01 00:19:27 +0100
commite86a3b73808f23c9361274c6c4781a3b9f7950d3 (patch)
tree3e9770e57fe402a87882a0a6235aa83eeb8eac39
parent17c73a0980186018b2380ddad96b01eab68b43fa (diff)
Improve performance more with a cached repo
Once we've cached the whole repo, stop trying to add more files. It takes a long time if we keep trying to lookup things that are not in the cache.
-rw-r--r--Perl/Local/VCS_git.pm6
-rwxr-xr-xvcs-test.pl1
2 files changed, 7 insertions, 0 deletions
diff --git a/Perl/Local/VCS_git.pm b/Perl/Local/VCS_git.pm
index 51ed046fbd6..378ba9d66a5 100644
--- a/Perl/Local/VCS_git.pm
+++ b/Perl/Local/VCS_git.pm
@@ -143,6 +143,12 @@ sub cache_file {
my $file = shift;
_debug "cache_file($file)";
+
+ if ($self->{REPO_CACHED}) {
+ _debug "cache_file() returning early - whole repo already cached";
+ return;
+ }
+
if ($self->{CACHE}{"$file"}) {
_debug "$file is already cached...";
_debug "cache_file($file) returning early";
diff --git a/vcs-test.pl b/vcs-test.pl
index 0870c62bcf0..05a27bcf8c1 100755
--- a/vcs-test.pl
+++ b/vcs-test.pl
@@ -43,6 +43,7 @@ $VCS->cache_file($file);
$VCS->cache_file($file);
$VCS->cache_repo();
$VCS->cache_repo();
+$VCS->cache_file($file);
print " ... done!\n";
########

© 2014-2024 Faster IT GmbH | imprint | privacy policy