diff options
author | Eric Wong <e@80x24.org> | 2014-04-20 11:17:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-04-20 11:17:16 +0000 |
commit | 0e356ebfa0bbbbb2a7582657435cf681d92387f2 (patch) | |
tree | af04e02307dd3120a9cb6cc30b1e6c3f5a7f175a /public-inbox.cgi | |
parent | 4f80faf0172fefd570d3b67c3c02b55d1bd330fc (diff) | |
download | public-inbox-0e356ebfa0bbbbb2a7582657435cf681d92387f2.tar.gz |
This shaves off nearly 100ms when my Core2Duo is clocked to 800Mhz when rendering a full HTML index.
Diffstat (limited to 'public-inbox.cgi')
-rwxr-xr-x | public-inbox.cgi | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/public-inbox.cgi b/public-inbox.cgi index 5e281580..03202c61 100755 --- a/public-inbox.cgi +++ b/public-inbox.cgi @@ -16,7 +16,6 @@ use CGI qw(:cgi :escapeHTML -nosticky); # PSGI/FastCGI/mod_perl compat use Encode qw(decode_utf8); use PublicInbox::Config; use URI::Escape qw(uri_escape uri_unescape); -use Digest::SHA qw(sha1_hex); our $LISTNAME_RE = qr!\A/([\w\.\-]+)!; our $pi_config; BEGIN { @@ -150,7 +149,8 @@ sub get_index { sub mid2blob { my ($ctx) = @_; local $ENV{GIT_DIR} = $ctx->{git_dir}; - my $hex = sha1_hex($ctx->{mid}); + require Digest::SHA; + my $hex = Digest::SHA::sha1_hex($ctx->{mid}); $hex =~ /\A([a-f0-9]{2})([a-f0-9]{38})\z/i or die "BUG: not a SHA-1 hex: $hex"; my $blob = `git cat-file blob HEAD:$1/$2 2>/dev/null`; |