* Optimise displaytime, trimming maybe 6% off the build time.

master
joey 2007-04-10 01:49:16 +00:00
parent 15d61ff4ed
commit 13c7a51f1f
7 changed files with 9 additions and 19 deletions

View File

@ -6,6 +6,7 @@ use strict;
use Encode;
use HTML::Entities;
use URI::Escape q{uri_escape_utf8};
use POSIX;
use open qw{:utf8 :std};
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
@ -83,8 +84,6 @@ sub checkconfig () { #{{{
delete $ENV{LC_ALL};
}
if (defined $config{locale}) {
eval q{use POSIX};
error($@) if $@;
if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) {
$ENV{LANG}=$config{locale};
$gettext_obj=undef;
@ -434,8 +433,6 @@ sub abs2rel ($$) { #{{{
sub displaytime ($) { #{{{
my $time=shift;
eval q{use POSIX};
error($@) if $@;
# strftime doesn't know about encodings, so make sure
# its output is properly treated as utf8
return decode_utf8(POSIX::strftime(

View File

@ -319,7 +319,6 @@ sub add_page (@) { #{{{
# Make sure that the file name isn't too long.
# NB: This doesn't check for path length limits.
eval q{use POSIX};
my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX);
if (defined $max && length(htmlfn($page)) >= $max) {
$c="";

View File

@ -266,8 +266,6 @@ sub get_inline_content ($$) { #{{{
sub date_822 ($) { #{{{
my $time=shift;
eval q{use POSIX};
error($@) if $@;
my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
@ -278,8 +276,6 @@ sub date_822 ($) { #{{{
sub date_3339 ($) { #{{{
my $time=shift;
eval q{use POSIX};
error($@) if $@;
my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
@ -401,7 +397,6 @@ sub pingurl (@) { #{{{
defined(my $pid = fork) or error("Can't fork: $!");
return if $pid;
chdir '/';
eval q{use POSIX 'setsid'};
setsid() or error("Can't start a new session: $!");
open STDIN, '/dev/null';
open STDOUT, '>/dev/null';

View File

@ -3,7 +3,6 @@
use warnings;
use strict;
use IkiWiki;
use POSIX qw(setlocale LC_CTYPE);
package IkiWiki;

View File

@ -157,7 +157,6 @@ sub send_commit_mails ($$$@) { #{{{
# Daemonize, in case the mail sending takes a while.
defined(my $pid = fork) or error("Can't fork: $!");
return if $pid;
eval q{use POSIX 'setsid'};
setsid() or error("Can't start a new session: $!");
chdir '/';
open STDIN, '/dev/null';

3
debian/changelog vendored
View File

@ -14,8 +14,9 @@ ikiwiki (1.50) UNRELEASED; urgency=low
the source page used to create it, ie it's the reverse of %renderedfiles.
* Use %destsources in htmllink and urlto for 20-50% speedup. Thanks
Josh Triplett for the idea.
* Optimise displaytime, trimming maybe 6% off the build time.
-- Joey Hess <joeyh@debian.org> Mon, 09 Apr 2007 21:09:32 -0400
-- Joey Hess <joeyh@debian.org> Mon, 09 Apr 2007 21:42:14 -0400
ikiwiki (1.49) unstable; urgency=low

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-04-09 21:13-0400\n"
"POT-Creation-Date: 2007-04-09 21:45-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -101,7 +101,7 @@ msgstr ""
msgid "processed ok at %s"
msgstr ""
#: ../IkiWiki/Plugin/aggregate.pm:334
#: ../IkiWiki/Plugin/aggregate.pm:333
#, perl-format
msgid "creating new page %s"
msgstr ""
@ -169,7 +169,7 @@ msgstr ""
msgid "Discussion"
msgstr ""
#: ../IkiWiki/Plugin/inline.pm:396
#: ../IkiWiki/Plugin/inline.pm:392
msgid "RPC::XML::Client not found, not pinging"
msgstr ""
@ -541,11 +541,11 @@ msgstr ""
msgid "usage: ikiwiki [options] source dest"
msgstr ""
#: ../IkiWiki.pm:105
#: ../IkiWiki.pm:104
msgid "Must specify url to wiki with --url when using --cgi"
msgstr ""
#: ../IkiWiki.pm:152 ../IkiWiki.pm:153
#: ../IkiWiki.pm:151 ../IkiWiki.pm:152
msgid "Error"
msgstr ""
@ -553,7 +553,7 @@ msgstr ""
#. translators: preprocessor directive name,
#. translators: the second a page name, the
#. translators: third a number.
#: ../IkiWiki.pm:625
#: ../IkiWiki.pm:622
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr ""