toddr/IPC-Run — pull request #1 by eserte (2013-04-18 13:16:51+00:00)
Title: micro optimization

Some micro optimizations to IPC::Run. With these two commits two test script below runs somewhat faster, about 10% on my system:

srezic-micro-optimization: env IPCRUNDEBUG=none perl -Mblib /tmp/ipc-run-1000.pl
2.83188390731812
master: env IPCRUNDEBUG=none perl -Mblib /tmp/ipc-run-1000.pl
3.12365984916687

srezic-micro-optimization: perl -Mblib /tmp/ipc-run-1000.pl
3.19277095794678
master: perl -Mblib /tmp/ipc-run-1000.pl
3.4070770740509

#!/usr/bin/perl

use strict;
use IPC::Run qw(run);
use Time::HiRes qw(time);

my $n = 1000;

{
my $t0 = time;
run ['echo', 'foo'], '|', ['true']
for 1..$n;
warn time-$t0, "\n";
}
__END__