Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Exercise update_prefix every thousand messages when in benchmark

  • Loading branch information...
commit ff8ac976ed0006c377da84904992f7041cf2f7ba 1 parent 97276b2
@athomason authored
Showing with 9 additions and 3 deletions.
  1. +7 −1 benchmarks/bench-sizes.pl
  2. +2 −2 benchmarks/bench-tarballs.pl
View
8 benchmarks/bench-sizes.pl
@@ -32,7 +32,13 @@
'benchmark',
);
- $loggers{sprintf '%4d', $size} = sub { $logger->send($msg) };
+ my $n = 0;
+ $loggers{sprintf '%4d', $size} = sub {
+ if ($n++ % 1000 == 0) {
+ $logger->set_pid($$);
+ }
+ $logger->send($msg);
+ };
}
timethese(-$seconds, \%loggers);
View
4 benchmarks/bench-tarballs.pl
@@ -57,7 +57,7 @@
my $script = "$Bin/bench-sizes.pl";
- my @classes = 'Log::Syslog::Fast';
+ my @classes = ('Log::Syslog::Fast');
push @classes, 'Log::Syslog::Fast::PP' if -e 'blib/lib/Log/Syslog/Fast/PP.pm';
for my $class (@classes) {
@@ -66,7 +66,7 @@
$verbose && print "$_\n" for @results;
for (@results) {
if (m{(\d+)[^@]+@ ([0-9.]+)/s}) {
- $results{$class}{$name}{$1} = $2;
+ $results{$class}{$name}{sprintf "%4d", $1} = 0+$2;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.