Re: [PATCH 1/3] Git.pm: Add faculties to allow temp files to be cached

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Wong
Date: Wednesday, August 13, 2008 - 11:58 pm

Junio C Hamano <gitster@pobox.com> wrote:

What about just lazy requiring inside _temp_cache() so it
won't get loaded by folks that don't need it? (completely untested):

		eval { require File::Temp };
		if ($@) {
			throw Error::Simple("couldn't require File::Temp: $@");
		}
		eval { require File::Spec };
		if ($@) {
			throw Error::Simple("couldn't require File::Spec: $@");
		}

It'll also remove the minor performance hit CGI/gitweb users got since
we won't load these extra modules during startup.


Fwiw, git-svn has been a File::Temp user for a few months since Adam's
cat-file optimization; but it also has lower visibility since boxes
with <5.6.1 probably don't have SVN.  git-svn previously used
IO::File->new_tmpfile exclusively (and very heavily).

-- 
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] git-svn and temporary file improvements, Marcus Griep, (Mon Aug 11, 8:53 am)
[PATCH] Git.pm: require Perl 5.6.1, Lea Wiemann, (Wed Aug 13, 3:30 pm)
Re: [PATCH 1/3] Git.pm: Add faculties to allow temp files ..., Eric Wong, (Wed Aug 13, 11:58 pm)