Skip to content

Commit

Permalink
increase CGI performance slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 14, 2012
1 parent ae48027 commit 3eb7538
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojo.pm
Expand Up @@ -5,7 +5,6 @@ use Carp 'croak';
use Mojo::Home;
use Mojo::Log;
use Mojo::Transaction::HTTP;
use Mojo::UserAgent;
use Scalar::Util 'weaken';

has home => sub { Mojo::Home->new };
Expand All @@ -14,6 +13,7 @@ has ua => sub {
my $self = shift;

# Fresh user agent
require Mojo::UserAgent;
my $ua = Mojo::UserAgent->new->app($self);
weaken $self;
$ua->on(error => sub { $self->log->error(pop) });
Expand Down
3 changes: 3 additions & 0 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -14,6 +14,9 @@ use POSIX qw/setsid WNOHANG/;
use Scalar::Util 'weaken';
use Time::HiRes 'ualarm';

# Preload
require Mojo::UserAgent;

sub DESTROY {
my $self = shift;

Expand Down

0 comments on commit 3eb7538

Please sign in to comment.