Scenario/IPCRun/run_stdin.pm

filter: Statementstmt 100% 10 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Scenario/IPCRun/run_overhead.pm ↑ Summary Scenarios/IPCRun.pm »
1 package Bencher::Scenario::IPCRun::run_stdin;
2  
3 1 our $DATE = '2017-01-25'; # DATE
4 1 our $VERSION = '0.002'; # VERSION
5  
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our $scenario = {
10 summary => "Benchmark run()'s stdin vs opening a pipe",
11 modules => {
12 },
13 participants => [
14 {
15 module => 'IPC::Run',
16 function => 'run',
17 code_template => 'state $in = "a" x <input_size>; IPC::Run::run(["true"], \$in) or die',
18 },
19 {
20 name => 'system',
21 code_template => 'state $in = "a" x <input_size>; open my($fh), "|true" or die; print $fh $in',
22 },
23 ],
24 datasets => [
25 {args=>{input_size=>0}},
26 {args=>{input_size=>1024}},
27 #{args=>{input_size=>50*1024}}, # also dies when we run under PWP:Bencher::Scenario
28 # 1MB causes silent exit, why
29 ],
30 };
31  
32 1 1;
33 # ABSTRACT: Benchmark run()'s stdin vs opening a pipe
34  
35 __END__
« Scenario/IPCRun/run_overhead.pm ↑ Summary Scenarios/IPCRun.pm »