# 4 GHz, CentOS 7 ( Perl v5.16.3 )
$ perl foo1.pl | wc -l # Foo::Inbox
duration: 0.441 seconds
50000
$ perl inbox.pl | wc -l # MCE::Inbox w/ blocking capability
duration: 0.422 seconds
50000
$ perl foo2.pl | wc -l # MCE::Shared->queue
duration: 0.645 seconds
50000
$ perl foo4.pl | wc -l # Thread::Queue
duration: 1.544 seconds
50000
####
# 4 GHz, CentOS 7 ( Perl v5.16.3 )
$ perl foo1.pl | wc -l # Foo::Inbox
duration: 12.685 seconds
1600000
$ perl inbox.pl | wc -l # MCE::Inbox w/ blocking capability
duration: 15.939 seconds
1600000
$ perl foo2.pl | wc -l # MCE::Shared->queue
duration: 21.533 seconds
1600000
$ perl foo4.pl | wc -l # Thread::Queue
duration: 90.015 seconds
1600000
##
##
my @names = shuffle qw/ Barny Betty Fred Wilma /;
foreach my $i ( 1 .. 5 ) {
push @names, map { $_.$i } @names;
print scalar(@names), "\n";
}
__END__
8
16
32
64
128
##
##
...
# send greeting again
$inbox->send($name, \@names, 'Hello') if $count < 98;
# eventually stop benchmarking
last if ++$count == 12500;
...