diff options
author | Eric Wong <normalperson@yhbt.net> | 2015-01-15 08:54:22 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2015-02-26 20:19:21 +0000 |
commit | 47092c10671da906ae626634dc83beb29ce76a9d (patch) | |
tree | 27980d2dafd0c5e3d7d14c7bd419e8cb8c099ef7 /perl/Git/SVN/Ra.pm | |
parent | 7f4ba4b6e3ba7075ca6b379ba23fd3088cbe69a8 (diff) | |
download | git-47092c10671da906ae626634dc83beb29ce76a9d.tar.gz |
git-svn: lazy load some modules
We can delay loading some modules until we need them for uncommon
code paths. For example, persistent memoization is not often
needed, so we can avoid loading the modules for it until we
encounter svn::mergeinfo during fetch.
This gives a tiny reduction in syscalls (from 15641 to 15305) when
running "git svn info" and counting via "strace -fc". Further,
more invasive work will be needed to noticeably improve performance.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'perl/Git/SVN/Ra.pm')
-rw-r--r-- | perl/Git/SVN/Ra.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm index 622535e217..cf36b9d3cd 100644 --- a/perl/Git/SVN/Ra.pm +++ b/perl/Git/SVN/Ra.pm @@ -3,7 +3,6 @@ use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/; use strict; use warnings; use Memoize; -use SVN::Client; use Git::SVN::Utils qw( canonicalize_url canonicalize_path @@ -42,6 +41,7 @@ END { } sub _auth_providers () { + require SVN::Client; my @rv = ( SVN::Client::get_simple_provider(), SVN::Client::get_ssl_server_trust_file_provider(), @@ -247,7 +247,10 @@ sub get_log { $ret; } +# uncommon, only for ancient SVN (<= 1.4.2) sub trees_match { + require IO::File; + require SVN::Client; my ($self, $url1, $rev1, $url2, $rev2) = @_; my $ctx = SVN::Client->new(auth => _auth_providers); my $out = IO::File->new_tmpfile; |