in reply to Re^2: How to capture compile errors from child program?
in thread How to capture compile errors from child program?
outputs#!/usr/bin/perl use strict; use warnings; use Benchmark qw(:all :hireswallclock) ; cmpthese(20, { 'Backtick' => sub{`echo plenty of fish` for 1 .. 10}, 'Open' => sub{for (1 .. 10){open my $fh, "echo plenty of fish |"; +<$fh>}}, });
on my Windows box andRate Open Backtick Open 9.29/s -- -1% Backtick 9.35/s 1% --
on a Linux server (with iteration count upped to be meaningful).Rate Open Backtick Open 85.8/s -- -10% Backtick 95.7/s 11% --
As an aside, if you are optimizing away milliseconds of overall run time, you probably shouldn't be using Perl.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to capture compile errors from child program?
by anonymized user 468275 (Curate) on Aug 04, 2015 at 09:01 UTC | |
by kennethk (Abbot) on Aug 04, 2015 at 15:03 UTC |