← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:06 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Eval/Closure.pm
StatementsExecuted 7871 statements in 30.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2081117.1ms17.1msEval::Closure::::_clean_evalEval::Closure::_clean_eval
208229.01ms31.3msEval::Closure::::eval_closureEval::Closure::eval_closure
208111.91ms20.9msEval::Closure::::_clean_eval_closureEval::Closure::_clean_eval_closure
20811824µs18.6msEval::Closure::::_make_compilerEval::Closure::_make_compiler
20811601µs646µsEval::Closure::::_canonicalize_sourceEval::Closure::_canonicalize_source
20811597µs718µsEval::Closure::::_validate_envEval::Closure::_validate_env
20811565µs736µsEval::Closure::::_make_compiler_sourceEval::Closure::_make_compiler_source
5711171µs171µsEval::Closure::::_make_lexical_assignmentEval::Closure::_make_lexical_assignment
2081169µs69µsEval::Closure::::CORE:sortEval::Closure::CORE:sort (opcode)
571155µs55µsEval::Closure::::CORE:matchEval::Closure::CORE:match (opcode)
1117µs14µsEval::Closure::::BEGIN@10Eval::Closure::BEGIN@10
1117µs45µsEval::Closure::::BEGIN@18Eval::Closure::BEGIN@18
1116µs34µsEval::Closure::::BEGIN@13Eval::Closure::BEGIN@13
1115µs7µsEval::Closure::::BEGIN@7Eval::Closure::BEGIN@7
1114µs4µsEval::Closure::::BEGIN@2Eval::Closure::BEGIN@2
1114µs20µsEval::Closure::::BEGIN@16Eval::Closure::BEGIN@16
1114µs18µsEval::Closure::::BEGIN@15Eval::Closure::BEGIN@15
1114µs5µsEval::Closure::::BEGIN@6Eval::Closure::BEGIN@6
1112µs2µsEval::Closure::::BEGIN@14Eval::Closure::BEGIN@14
0000s0sEval::Closure::::__ANON__[:185]Eval::Closure::__ANON__[:185]
0000s0sEval::Closure::::_dump_sourceEval::Closure::_dump_source
0000s0sEval::Closure::::_line_directiveEval::Closure::_line_directive
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Eval::Closure;
2
# spent 4µs within Eval::Closure::BEGIN@2 which was called: # once (4µs+0s) by Class::MOP::Method::Generated::BEGIN@7 at line 4
BEGIN {
313µs $Eval::Closure::AUTHORITY = 'cpan:DOY';
4114µs14µs}
# spent 4µs making 1 call to Eval::Closure::BEGIN@2
51400ns$Eval::Closure::VERSION = '0.13';
6212µs26µs
# spent 5µs (4+1) within Eval::Closure::BEGIN@6 which was called: # once (4µs+1µs) by Class::MOP::Method::Generated::BEGIN@7 at line 6
use strict;
# spent 5µs making 1 call to Eval::Closure::BEGIN@6 # spent 1µs making 1 call to strict::import
7215µs210µs
# spent 7µs (5+2) within Eval::Closure::BEGIN@7 which was called: # once (5µs+2µs) by Class::MOP::Method::Generated::BEGIN@7 at line 7
use warnings;
# spent 7µs making 1 call to Eval::Closure::BEGIN@7 # spent 2µs making 1 call to warnings::import
8# ABSTRACT: safely and cleanly create closures via string eval
9
10222µs221µs
# spent 14µs (7+7) within Eval::Closure::BEGIN@10 which was called: # once (7µs+7µs) by Class::MOP::Method::Generated::BEGIN@7 at line 10
use Exporter 'import';
# spent 14µs making 1 call to Eval::Closure::BEGIN@10 # spent 7µs making 1 call to Exporter::import
111800ns@Eval::Closure::EXPORT = @Eval::Closure::EXPORT_OK = 'eval_closure';
12
13217µs263µs
# spent 34µs (6+28) within Eval::Closure::BEGIN@13 which was called: # once (6µs+28µs) by Class::MOP::Method::Generated::BEGIN@7 at line 13
use Carp;
# spent 34µs making 1 call to Eval::Closure::BEGIN@13 # spent 28µs making 1 call to Exporter::import
14213µs12µs
# spent 2µs within Eval::Closure::BEGIN@14 which was called: # once (2µs+0s) by Class::MOP::Method::Generated::BEGIN@7 at line 14
use overload ();
# spent 2µs making 1 call to Eval::Closure::BEGIN@14
15212µs232µs
# spent 18µs (4+14) within Eval::Closure::BEGIN@15 which was called: # once (4µs+14µs) by Class::MOP::Method::Generated::BEGIN@7 at line 15
use Scalar::Util qw(reftype);
# spent 18µs making 1 call to Eval::Closure::BEGIN@15 # spent 14µs making 1 call to Exporter::import
16218µs237µs
# spent 20µs (4+16) within Eval::Closure::BEGIN@16 which was called: # once (4µs+16µs) by Class::MOP::Method::Generated::BEGIN@7 at line 16
use Try::Tiny;
# spent 20µs making 1 call to Eval::Closure::BEGIN@16 # spent 16µs making 1 call to Exporter::import
17
182603µs284µs
# spent 45µs (7+38) within Eval::Closure::BEGIN@18 which was called: # once (7µs+38µs) by Class::MOP::Method::Generated::BEGIN@7 at line 18
use constant HAS_LEXICAL_SUBS => $] >= 5.018;
# spent 45µs making 1 call to Eval::Closure::BEGIN@18 # spent 38µs making 1 call to constant::import
19
- -
22
# spent 31.3ms (9.01+22.3) within Eval::Closure::eval_closure which was called 208 times, avg 150µs/call: # 131 times (4.39ms+15.8ms) by Class::MOP::Method::Generated::_compile_code at line 56 of Class/MOP/Method/Generated.pm, avg 154µs/call # 77 times (4.62ms+6.44ms) by Moose::Meta::TypeConstraint::_actually_compile_type_constraint at line 288 of Moose/Meta/TypeConstraint.pm, avg 144µs/call
sub eval_closure {
23208173µs my (%args) = @_;
24
25 # default to copying environment
2620897µs $args{alias} = 0 if !exists $args{alias};
27
28208188µs208646µs $args{source} = _canonicalize_source($args{source});
# spent 646µs making 208 calls to Eval::Closure::_canonicalize_source, avg 3µs/call
29208151µs208718µs _validate_env($args{environment} ||= {});
# spent 718µs making 208 calls to Eval::Closure::_validate_env, avg 3µs/call
30
31 $args{source} = _line_directive(@args{qw(line description)})
32 . $args{source}
33208132µs if defined $args{description} && !($^P & 0x10);
34
35208223µs20820.9ms my ($code, $e) = _clean_eval_closure(@args{qw(source environment alias)});
# spent 20.9ms making 208 calls to Eval::Closure::_clean_eval_closure, avg 100µs/call
36
3720835µs if (!$code) {
38 if ($args{terse_error}) {
39 die "$e\n";
40 }
41 else {
42 croak("Failed to compile source: $e\n\nsource:\n$args{source}")
43 }
44 }
45
46208358µs return $code;
47}
48
49
# spent 646µs (601+45) within Eval::Closure::_canonicalize_source which was called 208 times, avg 3µs/call: # 208 times (601µs+45µs) by Eval::Closure::eval_closure at line 28, avg 3µs/call
sub _canonicalize_source {
5020841µs my ($source) = @_;
51
5220843µs if (defined($source)) {
5320851µs if (ref($source)) {
541313.91ms13145µs if (reftype($source) eq 'ARRAY'
# spent 45µs making 131 calls to Scalar::Util::reftype, avg 347ns/call
55 || overload::Method($source, '@{}')) {
56 return join "\n", @$source;
57 }
58 elsif (overload::Method($source, '""')) {
59 return "$source";
60 }
61 else {
62 croak("The 'source' parameter to eval_closure must be a "
63 . "string or array reference");
64 }
65 }
66 else {
6777104µs return $source;
68 }
69 }
70 else {
71 croak("The 'source' parameter to eval_closure is required");
72 }
73}
74
75
# spent 718µs (597+120) within Eval::Closure::_validate_env which was called 208 times, avg 3µs/call: # 208 times (597µs+120µs) by Eval::Closure::eval_closure at line 29, avg 3µs/call
sub _validate_env {
7620835µs my ($env) = @_;
77
78208281µs20866µs croak("The 'environment' parameter must be a hashref")
# spent 66µs making 208 calls to Scalar::Util::reftype, avg 316ns/call
79 unless reftype($env) eq 'HASH';
80
81208348µs for my $var (keys %$env) {
825710µs if (HAS_LEXICAL_SUBS) {
8357113µs5755µs croak("Environment key '$var' should start with \@, \%, \$, or \&")
# spent 55µs making 57 calls to Eval::Closure::CORE:match, avg 960ns/call
84 unless $var =~ /^([\@\%\$\&])/;
85 }
86 else {
87 croak("Environment key '$var' should start with \@, \%, or \$")
88 unless $var =~ /^([\@\%\$])/;
89 }
90 croak("Environment values must be references, not $env->{$var}")
915727µs unless ref($env->{$var});
92 }
93}
94
95sub _line_directive {
96 my ($line, $description) = @_;
97
98 $line = 1 unless defined($line);
99
100 return qq{#line $line "$description"\n};
101}
102
103
# spent 20.9ms (1.91+19.0) within Eval::Closure::_clean_eval_closure which was called 208 times, avg 100µs/call: # 208 times (1.91ms+19.0ms) by Eval::Closure::eval_closure at line 35, avg 100µs/call
sub _clean_eval_closure {
10420863µs my ($source, $captures, $alias) = @_;
105
106208357µs20869µs my @capture_keys = sort keys %$captures;
# spent 69µs making 208 calls to Eval::Closure::CORE:sort, avg 330ns/call
107
10820861µs if ($ENV{EVAL_CLOSURE_PRINT_SOURCE}) {
109 _dump_source(_make_compiler_source($source, $alias, @capture_keys));
110 }
111
112208253µs20818.6ms my ($compiler, $e) = _make_compiler($source, $alias, @capture_keys);
# spent 18.6ms making 208 calls to Eval::Closure::_make_compiler, avg 90µs/call
11320824µs my $code;
114208291µs208295µs if (defined $compiler) {
# spent 5µs making 1 call to Eval::Closure::Sandbox_159::__ANON__[(eval 193)[Eval/Closure.pm:142]:90] # spent 3µs making 1 call to Eval::Closure::Sandbox_68::__ANON__[(eval 101)[Eval/Closure.pm:142]:100] # spent 3µs making 1 call to Eval::Closure::Sandbox_154::__ANON__[(eval 188)[Eval/Closure.pm:142]:21] # spent 3µs making 1 call to Eval::Closure::Sandbox_19::__ANON__[(eval 51)[Eval/Closure.pm:142]:55] # spent 3µs making 1 call to Eval::Closure::Sandbox_157::__ANON__[(eval 191)[Eval/Closure.pm:142]:23] # spent 2µs making 1 call to Eval::Closure::Sandbox_151::__ANON__[(eval 185)[Eval/Closure.pm:142]:18] # spent 2µs making 1 call to Eval::Closure::Sandbox_158::__ANON__[(eval 192)[Eval/Closure.pm:142]:16] # spent 2µs making 1 call to Eval::Closure::Sandbox_100::__ANON__[(eval 133)[Eval/Closure.pm:142]:139] # spent 2µs making 1 call to Eval::Closure::Sandbox_117::__ANON__[(eval 150)[Eval/Closure.pm:142]:157] # spent 2µs making 1 call to Eval::Closure::Sandbox_106::__ANON__[(eval 139)[Eval/Closure.pm:142]:100] # spent 2µs making 1 call to Eval::Closure::Sandbox_17::__ANON__[(eval 49)[Eval/Closure.pm:142]:49] # spent 2µs making 1 call to Eval::Closure::Sandbox_74::__ANON__[(eval 107)[Eval/Closure.pm:142]:106] # spent 2µs making 1 call to Eval::Closure::Sandbox_75::__ANON__[(eval 108)[Eval/Closure.pm:142]:25] # spent 2µs making 1 call to Eval::Closure::Sandbox_128::__ANON__[(eval 161)[Eval/Closure.pm:142]:31] # spent 2µs making 1 call to Eval::Closure::Sandbox_34::__ANON__[(eval 66)[Eval/Closure.pm:142]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_36::__ANON__[(eval 68)[Eval/Closure.pm:142]:55] # spent 2µs making 1 call to Eval::Closure::Sandbox_83::__ANON__[(eval 116)[Eval/Closure.pm:142]:40] # spent 2µs making 1 call to Eval::Closure::Sandbox_84::__ANON__[(eval 117)[Eval/Closure.pm:142]:28] # spent 2µs making 1 call to Eval::Closure::Sandbox_109::__ANON__[(eval 142)[Eval/Closure.pm:142]:16] # spent 2µs making 1 call to Eval::Closure::Sandbox_119::__ANON__[(eval 152)[Eval/Closure.pm:142]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_125::__ANON__[(eval 158)[Eval/Closure.pm:142]:31] # spent 2µs making 1 call to Eval::Closure::Sandbox_186::__ANON__[(eval 272)[Eval/Closure.pm:142]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_24::__ANON__[(eval 56)[Eval/Closure.pm:142]:55] # spent 2µs making 1 call to Eval::Closure::Sandbox_33::__ANON__[(eval 65)[Eval/Closure.pm:142]:52] # spent 2µs making 1 call to Eval::Closure::Sandbox_52::__ANON__[(eval 84)[Eval/Closure.pm:142]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_65::__ANON__[(eval 97)[Eval/Closure.pm:142]:11] # spent 2µs making 1 call to Eval::Closure::Sandbox_81::__ANON__[(eval 114)[Eval/Closure.pm:142]:28] # spent 2µs making 1 call to Eval::Closure::Sandbox_85::__ANON__[(eval 118)[Eval/Closure.pm:142]:28] # spent 2µs making 1 call to Eval::Closure::Sandbox_107::__ANON__[(eval 140)[Eval/Closure.pm:142]:28] # spent 2µs making 1 call to Eval::Closure::Sandbox_111::__ANON__[(eval 144)[Eval/Closure.pm:142]:19] # spent 2µs making 1 call to Eval::Closure::Sandbox_122::__ANON__[(eval 155)[Eval/Closure.pm:142]:31] # spent 2µs making 1 call to Eval::Closure::Sandbox_126::__ANON__[(eval 159)[Eval/Closure.pm:142]:25] # spent 2µs making 1 call to Eval::Closure::Sandbox_160::__ANON__[(eval 194)[Eval/Closure.pm:142]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_29::__ANON__[(eval 61)[Eval/Closure.pm:142]:55] # spent 2µs making 1 call to Eval::Closure::Sandbox_77::__ANON__[(eval 110)[Eval/Closure.pm:142]:11] # spent 2µs making 1 call to Eval::Closure::Sandbox_79::__ANON__[(eval 112)[Eval/Closure.pm:142]:27] # spent 2µs making 1 call to Eval::Closure::Sandbox_80::__ANON__[(eval 113)[Eval/Closure.pm:142]:27] # spent 2µs making 1 call to Eval::Closure::Sandbox_82::__ANON__[(eval 115)[Eval/Closure.pm:142]:46] # spent 2µs making 1 call to Eval::Closure::Sandbox_31::__ANON__[(eval 63)[Eval/Closure.pm:142]:52] # spent 2µs making 1 call to Eval::Closure::Sandbox_38::__ANON__[(eval 70)[Eval/Closure.pm:142]:52] # spent 2µs making 1 call to Eval::Closure::Sandbox_43::__ANON__[(eval 75)[Eval/Closure.pm:142]:22] # spent 2µs making 1 call to Eval::Closure::Sandbox_57::__ANON__[(eval 89)[Eval/Closure.pm:142]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_120::__ANON__[(eval 153)[Eval/Closure.pm:142]:25] # spent 2µs making 1 call to Eval::Closure::Sandbox_72::__ANON__[(eval 105)[Eval/Closure.pm:142]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_88::__ANON__[(eval 121)[Eval/Closure.pm:142]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_37::__ANON__[(eval 69)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_108::__ANON__[(eval 141)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_112::__ANON__[(eval 145)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_113::__ANON__[(eval 146)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_114::__ANON__[(eval 147)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_131::__ANON__[(eval 164)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_152::__ANON__[(eval 186)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_173::__ANON__[(eval 238)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_194::__ANON__[(eval 291)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_32::__ANON__[(eval 64)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_51::__ANON__[(eval 83)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_53::__ANON__[(eval 85)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_66::__ANON__[(eval 99)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_69::__ANON__[(eval 102)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_70::__ANON__[(eval 103)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_76::__ANON__[(eval 109)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_87::__ANON__[(eval 120)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_92::__ANON__[(eval 125)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_101::__ANON__[(eval 134)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_102::__ANON__[(eval 135)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_103::__ANON__[(eval 136)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_105::__ANON__[(eval 138)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_118::__ANON__[(eval 151)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_123::__ANON__[(eval 156)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_127::__ANON__[(eval 160)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_132::__ANON__[(eval 165)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_134::__ANON__[(eval 167)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_137::__ANON__[(eval 170)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_142::__ANON__[(eval 175)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_144::__ANON__[(eval 177)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_149::__ANON__[(eval 183)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_150::__ANON__[(eval 184)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_153::__ANON__[(eval 187)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_15::__ANON__[(eval 47)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_161::__ANON__[(eval 220)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_163::__ANON__[(eval 222)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_181::__ANON__[(eval 259)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_189::__ANON__[(eval 275)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_190::__ANON__[(eval 276)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_191::__ANON__[(eval 288)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_192::__ANON__[(eval 289)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_195::__ANON__[(eval 293)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_205::__ANON__[(eval 307)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_206::__ANON__[(eval 308)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_207::__ANON__[(eval 311)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_25::__ANON__[(eval 57)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_30::__ANON__[(eval 62)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_35::__ANON__[(eval 67)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_39::__ANON__[(eval 71)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_86::__ANON__[(eval 119)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_89::__ANON__[(eval 122)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_8::__ANON__[(eval 40)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_91::__ANON__[(eval 124)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_93::__ANON__[(eval 126)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_94::__ANON__[(eval 127)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_95::__ANON__[(eval 128)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_97::__ANON__[(eval 130)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_98::__ANON__[(eval 131)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_9::__ANON__[(eval 41)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_110::__ANON__[(eval 143)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_115::__ANON__[(eval 148)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_11::__ANON__[(eval 43)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_129::__ANON__[(eval 162)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_12::__ANON__[(eval 44)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_133::__ANON__[(eval 166)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_135::__ANON__[(eval 168)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_138::__ANON__[(eval 171)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_139::__ANON__[(eval 172)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_143::__ANON__[(eval 176)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_147::__ANON__[(eval 180)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_14::__ANON__[(eval 46)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_155::__ANON__[(eval 189)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_156::__ANON__[(eval 190)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_165::__ANON__[(eval 228)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_167::__ANON__[(eval 231)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_168::__ANON__[(eval 232)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_169::__ANON__[(eval 233)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_170::__ANON__[(eval 234)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_171::__ANON__[(eval 235)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_174::__ANON__[(eval 239)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_175::__ANON__[(eval 240)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_177::__ANON__[(eval 243)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_182::__ANON__[(eval 260)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_185::__ANON__[(eval 271)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_187::__ANON__[(eval 273)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_188::__ANON__[(eval 274)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_18::__ANON__[(eval 50)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_193::__ANON__[(eval 290)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_1::__ANON__[(eval 33)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_201::__ANON__[(eval 299)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_202::__ANON__[(eval 300)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_204::__ANON__[(eval 303)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_20::__ANON__[(eval 52)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_2::__ANON__[(eval 34)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_44::__ANON__[(eval 76)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_60::__ANON__[(eval 92)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_67::__ANON__[(eval 100)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_73::__ANON__[(eval 106)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_78::__ANON__[(eval 111)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_90::__ANON__[(eval 123)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_96::__ANON__[(eval 129)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_99::__ANON__[(eval 132)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_104::__ANON__[(eval 137)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_10::__ANON__[(eval 42)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_116::__ANON__[(eval 149)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_121::__ANON__[(eval 154)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_124::__ANON__[(eval 157)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_136::__ANON__[(eval 169)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_13::__ANON__[(eval 45)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_140::__ANON__[(eval 173)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_141::__ANON__[(eval 174)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_148::__ANON__[(eval 181)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_162::__ANON__[(eval 221)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_164::__ANON__[(eval 223)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_166::__ANON__[(eval 229)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_172::__ANON__[(eval 236)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_178::__ANON__[(eval 244)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_179::__ANON__[(eval 246)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_180::__ANON__[(eval 247)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_183::__ANON__[(eval 264)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_196::__ANON__[(eval 294)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_197::__ANON__[(eval 295)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_199::__ANON__[(eval 297)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_203::__ANON__[(eval 302)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_208::__ANON__[(eval 312)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_21::__ANON__[(eval 53)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_22::__ANON__[(eval 54)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_23::__ANON__[(eval 55)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_27::__ANON__[(eval 59)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_3::__ANON__[(eval 35)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_40::__ANON__[(eval 72)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_41::__ANON__[(eval 73)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_46::__ANON__[(eval 78)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_4::__ANON__[(eval 36)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_50::__ANON__[(eval 82)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_55::__ANON__[(eval 87)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_56::__ANON__[(eval 88)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_58::__ANON__[(eval 90)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_61::__ANON__[(eval 93)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_71::__ANON__[(eval 104)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_130::__ANON__[(eval 163)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_145::__ANON__[(eval 178)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_146::__ANON__[(eval 179)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_184::__ANON__[(eval 265)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_198::__ANON__[(eval 296)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_200::__ANON__[(eval 298)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_26::__ANON__[(eval 58)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_28::__ANON__[(eval 60)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_42::__ANON__[(eval 74)[Eval/Closure.pm:142]:6] # spent 1µs making 1 call to Eval::Closure::Sandbox_45::__ANON__[(eval 77)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_48::__ANON__[(eval 80)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_49::__ANON__[(eval 81)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_54::__ANON__[(eval 86)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_59::__ANON__[(eval 91)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_62::__ANON__[(eval 94)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_63::__ANON__[(eval 95)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_64::__ANON__[(eval 96)[Eval/Closure.pm:142]:4] # spent 1µs making 1 call to Eval::Closure::Sandbox_6::__ANON__[(eval 38)[Eval/Closure.pm:142]:9] # spent 1µs making 1 call to Eval::Closure::Sandbox_7::__ANON__[(eval 39)[Eval/Closure.pm:142]:6] # spent 900ns making 1 call to Eval::Closure::Sandbox_16::__ANON__[(eval 48)[Eval/Closure.pm:142]:6] # spent 900ns making 1 call to Eval::Closure::Sandbox_176::__ANON__[(eval 241)[Eval/Closure.pm:142]:4] # spent 900ns making 1 call to Eval::Closure::Sandbox_47::__ANON__[(eval 79)[Eval/Closure.pm:142]:4] # spent 900ns making 1 call to Eval::Closure::Sandbox_5::__ANON__[(eval 37)[Eval/Closure.pm:142]:6]
115 $code = $compiler->(@$captures{@capture_keys});
116 }
117
118208144µs if (defined($code) && (!ref($code) || ref($code) ne 'CODE')) {
119 $e = "The 'source' parameter must return a subroutine reference, "
120 . "not $code";
121 undef $code;
122 }
123
12420829µs if ($alias) {
125 require Devel::LexAlias;
126 Devel::LexAlias::lexalias($code, $_, $captures->{$_})
127 for grep !/^\&/, keys %$captures;
128 }
129
1302084.33ms return ($code, $e);
131}
132
133
# spent 18.6ms (824µs+17.8) within Eval::Closure::_make_compiler which was called 208 times, avg 90µs/call: # 208 times (824µs+17.8ms) by Eval::Closure::_clean_eval_closure at line 112, avg 90µs/call
sub _make_compiler {
134208170µs208736µs my $source = _make_compiler_source(@_);
# spent 736µs making 208 calls to Eval::Closure::_make_compiler_source, avg 4µs/call
135
136208387µs20817.1ms return @{ _clean_eval($source) };
# spent 17.1ms making 208 calls to Eval::Closure::_clean_eval, avg 82µs/call
137}
138
139
# spent 17.1ms within Eval::Closure::_clean_eval which was called 208 times, avg 82µs/call: # 208 times (17.1ms+0s) by Eval::Closure::_make_compiler at line 136, avg 82µs/call
sub _clean_eval {
14020836µs local $@;
141208261µs local $SIG{__DIE__};
14220815.7ms my $compiler = eval $_[0];
# spent 5.24ms executing statements in 208 string evals (merged)
# includes 295µs spent executing 208 calls to 419 subs defined therein.
14320850µs my $e = $@;
144208707µs [ $compiler, $e ];
145}
146
1471200ns$Eval::Closure::SANDBOX_ID = 0;
148
149
# spent 736µs (565+171) within Eval::Closure::_make_compiler_source which was called 208 times, avg 4µs/call: # 208 times (565µs+171µs) by Eval::Closure::_make_compiler at line 134, avg 4µs/call
sub _make_compiler_source {
15020861µs my ($source, $alias, @capture_keys) = @_;
15120839µs $Eval::Closure::SANDBOX_ID++;
15220831µs my $i = 0;
153 return join "\n", (
154 "package Eval::Closure::Sandbox_$Eval::Closure::SANDBOX_ID;",
155 'sub {',
156265507µs57171µs (map { _make_lexical_assignment($_, $i++, $alias) } @capture_keys),
# spent 171µs making 57 calls to Eval::Closure::_make_lexical_assignment, avg 3µs/call
157 $source,
158 '}',
159 );
160}
161
162
# spent 171µs within Eval::Closure::_make_lexical_assignment which was called 57 times, avg 3µs/call: # 57 times (171µs+0s) by Eval::Closure::_make_compiler_source at line 156, avg 3µs/call
sub _make_lexical_assignment {
1635712µs my ($key, $index, $alias) = @_;
1645732µs my $sigil = substr($key, 0, 1);
1655716µs my $name = substr($key, 1);
1665710µs if (HAS_LEXICAL_SUBS && $sigil eq '&') {
167 my $tmpname = '$__' . $name . '__' . $index;
168 return 'use feature "lexical_subs"; '
169 . 'no warnings "experimental::lexical_subs"; '
170 . 'my ' . $tmpname . ' = $_[' . $index . ']; '
171 . 'my sub ' . $name . ' { goto ' . $tmpname . ' }';
172 }
173579µs if ($alias) {
174 return 'my ' . $key . ';';
175 }
176 else {
17757126µs return 'my ' . $key . ' = ' . $sigil . '{$_[' . $index . ']};';
178 }
179}
180
181sub _dump_source {
182 my ($source) = @_;
183
184 my $output;
185 if (try { require Perl::Tidy }) {
186 Perl::Tidy::perltidy(
187 source => \$source,
188 destination => \$output,
189 argv => [],
190 );
191 }
192 else {
193 $output = $source;
194 }
195
196 warn "$output\n";
197}
198
199
20013µs1;
201
202__END__
 
# spent 55µs within Eval::Closure::CORE:match which was called 57 times, avg 960ns/call: # 57 times (55µs+0s) by Eval::Closure::_validate_env at line 83, avg 960ns/call
sub Eval::Closure::CORE:match; # opcode
# spent 69µs within Eval::Closure::CORE:sort which was called 208 times, avg 330ns/call: # 208 times (69µs+0s) by Eval::Closure::_clean_eval_closure at line 106, avg 330ns/call
sub Eval::Closure::CORE:sort; # opcode