Skip to content

Commit

Permalink
improved Mojo::IOLoop performance by reducing stream timeout precisio…
Browse files Browse the repository at this point in the history
…n from 0.025 seconds to 0.5
  • Loading branch information
kraih committed Jul 7, 2012
1 parent f557ca0 commit c150e3a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -1,4 +1,8 @@

3.04 2012-07-07
- Improved Mojo::IOLoop performance by reducing stream timeout precision
from 0.025 seconds to 0.5.

3.03 2012-07-06
- Improved load balancing between Hypnotoad worker processes.
- Improved Hypnotoad log messages.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -54,7 +54,7 @@ sub start {
my $reactor = $self->reactor;
weaken $self;
$self->{timer} ||= $reactor->recurring(
0.025 => sub {
0.5 => sub {
return unless $self && (my $t = $self->timeout);
$self->emit_safe('timeout')->close if (time - ($self->{active})) >= $t;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -34,7 +34,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.03';
our $VERSION = '3.04';

# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/ioloop_tls.t
Expand Up @@ -98,7 +98,7 @@ $loop->client(
$stream->on(read => sub { $client .= pop });
}
);
$loop->timer(1 => sub { shift->stop });
$loop->timer(2 => sub { shift->stop });
$loop->start;
is $server, 'tset123', 'right content';
is $client, 'test321', 'right content';
Expand Down Expand Up @@ -191,7 +191,7 @@ $loop->client(
$stream->on(read => sub { $client .= pop });
}
);
$loop->timer(1 => sub { shift->stop });
$loop->timer(2 => sub { shift->stop });
$loop->start;
is $server, 'tset123', 'right content';
is $client, 'test321', 'right content';
Expand Down

0 comments on commit c150e3a

Please sign in to comment.