← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/Eval/Closure.pm
StatementsExecuted 9967 statements in 44.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2401132.0ms32.0msEval::Closure::::_clean_evalEval::Closure::_clean_eval
240225.33ms46.6msEval::Closure::::eval_closureEval::Closure::eval_closure
240112.74ms38.7msEval::Closure::::_clean_eval_closureEval::Closure::_clean_eval_closure
240111.36ms1.59msEval::Closure::::_validate_envEval::Closure::_validate_env
240111.34ms35.1msEval::Closure::::_make_compilerEval::Closure::_make_compiler
240111.17ms1.75msEval::Closure::::_make_compiler_sourceEval::Closure::_make_compiler_source
24011966µs1.05msEval::Closure::::_canonicalize_sourceEval::Closure::_canonicalize_source
22511575µs575µsEval::Closure::::_make_lexical_assignmentEval::Closure::_make_lexical_assignment
22511138µs138µsEval::Closure::::CORE:matchEval::Closure::CORE:match (opcode)
24011111µs111µsEval::Closure::::CORE:sortEval::Closure::CORE:sort (opcode)
1117µs7µsEval::Closure::::BEGIN@2Eval::Closure::BEGIN@2
1116µs36µsEval::Closure::::BEGIN@15Eval::Closure::BEGIN@15
1116µs28µsEval::Closure::::BEGIN@18Eval::Closure::BEGIN@18
1116µs32µsEval::Closure::::BEGIN@20Eval::Closure::BEGIN@20
1116µs9µsEval::Closure::::BEGIN@9Eval::Closure::BEGIN@9
1115µs11µsEval::Closure::::BEGIN@12Eval::Closure::BEGIN@12
1115µs23µsEval::Closure::::BEGIN@17Eval::Closure::BEGIN@17
1115µs15µsEval::Closure::::BEGIN@8Eval::Closure::BEGIN@8
1113µs3µsEval::Closure::::BEGIN@16Eval::Closure::BEGIN@16
0000s0sEval::Closure::::__ANON__[:175]Eval::Closure::__ANON__[:175]
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 7µs within Eval::Closure::BEGIN@2 which was called: # once (7µs+0s) by Class::MOP::Method::Generated::BEGIN@14 at line 4
BEGIN {
318µs $Eval::Closure::AUTHORITY = 'cpan:DOY';
4126µs17µs}
# spent 7µs making 1 call to Eval::Closure::BEGIN@2
5{
621µs $Eval::Closure::VERSION = '0.10';
7}
8218µs225µs
# spent 15µs (5+10) within Eval::Closure::BEGIN@8 which was called: # once (5µs+10µs) by Class::MOP::Method::Generated::BEGIN@14 at line 8
use strict;
# spent 15µs making 1 call to Eval::Closure::BEGIN@8 # spent 10µs making 1 call to strict::import
9221µs212µs
# spent 9µs (6+3) within Eval::Closure::BEGIN@9 which was called: # once (6µs+3µs) by Class::MOP::Method::Generated::BEGIN@14 at line 9
use warnings;
# spent 9µs making 1 call to Eval::Closure::BEGIN@9 # spent 3µs making 1 call to warnings::import
10# ABSTRACT: safely and cleanly create closures via string eval
11
12232µs217µs
# spent 11µs (5+6) within Eval::Closure::BEGIN@12 which was called: # once (5µs+6µs) by Class::MOP::Method::Generated::BEGIN@14 at line 12
use Exporter 'import';
# spent 11µs making 1 call to Eval::Closure::BEGIN@12 # spent 6µs making 1 call to Exporter::import
1311µs@Eval::Closure::EXPORT = @Eval::Closure::EXPORT_OK = 'eval_closure';
14
15218µs266µs
# spent 36µs (6+30) within Eval::Closure::BEGIN@15 which was called: # once (6µs+30µs) by Class::MOP::Method::Generated::BEGIN@14 at line 15
use Carp;
# spent 36µs making 1 call to Eval::Closure::BEGIN@15 # spent 30µs making 1 call to Exporter::import
16218µs13µs
# spent 3µs within Eval::Closure::BEGIN@16 which was called: # once (3µs+0s) by Class::MOP::Method::Generated::BEGIN@14 at line 16
use overload ();
# spent 3µs making 1 call to Eval::Closure::BEGIN@16
17218µs241µs
# spent 23µs (5+18) within Eval::Closure::BEGIN@17 which was called: # once (5µs+18µs) by Class::MOP::Method::Generated::BEGIN@14 at line 17
use Scalar::Util qw(reftype);
# spent 23µs making 1 call to Eval::Closure::BEGIN@17 # spent 18µs making 1 call to Exporter::import
18223µs251µs
# spent 28µs (6+22) within Eval::Closure::BEGIN@18 which was called: # once (6µs+22µs) by Class::MOP::Method::Generated::BEGIN@14 at line 18
use Try::Tiny;
# spent 28µs making 1 call to Eval::Closure::BEGIN@18 # spent 22µs making 1 call to Exporter::import
19
202885µs259µs
# spent 32µs (6+27) within Eval::Closure::BEGIN@20 which was called: # once (6µs+27µs) by Class::MOP::Method::Generated::BEGIN@14 at line 20
use constant HAS_LEXICAL_SUBS => $] >= 5.018;
# spent 32µs making 1 call to Eval::Closure::BEGIN@20 # spent 27µs making 1 call to constant::import
21
- -
24
# spent 46.6ms (5.33+41.3) within Eval::Closure::eval_closure which was called 240 times, avg 194µs/call: # 187 times (4.86ms+36.1ms) by Class::MOP::Method::Generated::_compile_code at line 63 of Class/MOP/Method/Generated.pm, avg 219µs/call # 53 times (473µs+5.17ms) by Moose::Meta::TypeConstraint::_actually_compile_type_constraint at line 311 of Moose/Meta/TypeConstraint.pm, avg 107µs/call
sub eval_closure {
25240243µs my (%args) = @_;
26
27240249µs2401.05ms $args{source} = _canonicalize_source($args{source});
# spent 1.05ms making 240 calls to Eval::Closure::_canonicalize_source, avg 4µs/call
28240226µs2401.59ms _validate_env($args{environment} ||= {});
# spent 1.59ms making 240 calls to Eval::Closure::_validate_env, avg 7µs/call
29
30240141µs $args{source} = _line_directive(@args{qw(line description)})
31 . $args{source}
32 if defined $args{description} && !($^P & 0x10);
33
34240315µs24038.7ms my ($code, $e) = _clean_eval_closure(@args{qw(source environment)});
# spent 38.7ms making 240 calls to Eval::Closure::_clean_eval_closure, avg 161µs/call
35
3624025µs if (!$code) {
37 if ($args{terse_error}) {
38 die "$e\n";
39 }
40 else {
41 croak("Failed to compile source: $e\n\nsource:\n$args{source}")
42 }
43 }
44
45240488µs return $code;
46}
47
48
# spent 1.05ms (966µs+88µs) within Eval::Closure::_canonicalize_source which was called 240 times, avg 4µs/call: # 240 times (966µs+88µs) by Eval::Closure::eval_closure at line 27, avg 4µs/call
sub _canonicalize_source {
4924034µs my ($source) = @_;
50
5124027µs if (defined($source)) {
5224044µs if (ref($source)) {
531873.96ms18788µs if (reftype($source) eq 'ARRAY'
# spent 88µs making 187 calls to Scalar::Util::reftype, avg 468ns/call
54 || overload::Method($source, '@{}')) {
55 return join "\n", @$source;
56 }
57 elsif (overload::Method($source, '""')) {
58 return "$source";
59 }
60 else {
61 croak("The 'source' parameter to eval_closure must be a "
62 . "string or array reference");
63 }
64 }
65 else {
665392µs return $source;
67 }
68 }
69 else {
70 croak("The 'source' parameter to eval_closure is required");
71 }
72}
73
74
# spent 1.59ms (1.36+233µs) within Eval::Closure::_validate_env which was called 240 times, avg 7µs/call: # 240 times (1.36ms+233µs) by Eval::Closure::eval_closure at line 28, avg 7µs/call
sub _validate_env {
7524031µs my ($env) = @_;
76
77240419µs24095µs croak("The 'environment' parameter must be a hashref")
# spent 95µs making 240 calls to Scalar::Util::reftype, avg 396ns/call
78 unless reftype($env) eq 'HASH';
79
80240530µs for my $var (keys %$env) {
812251µs if (HAS_LEXICAL_SUBS) {
82225387µs225138µs croak("Environment key '$var' should start with \@, \%, \$, or \&")
# spent 138µs making 225 calls to Eval::Closure::CORE:match, avg 613ns/call
83 unless $var =~ /^([\@\%\$\&])/;
84 }
85 else {
86 croak("Environment key '$var' should start with \@, \%, or \$")
87 unless $var =~ /^([\@\%\$])/;
88 }
89225104µs croak("Environment values must be references, not $env->{$var}")
90 unless ref($env->{$var});
91 }
92}
93
94sub _line_directive {
95 my ($line, $description) = @_;
96
97 $line = 1 unless defined($line);
98
99 return qq{#line $line "$description"\n};
100}
101
102
# spent 38.7ms (2.74+35.9) within Eval::Closure::_clean_eval_closure which was called 240 times, avg 161µs/call: # 240 times (2.74ms+35.9ms) by Eval::Closure::eval_closure at line 34, avg 161µs/call
sub _clean_eval_closure {
10324082µs my ($source, $captures) = @_;
104
105240518µs240111µs my @capture_keys = sort keys %$captures;
# spent 111µs making 240 calls to Eval::Closure::CORE:sort, avg 461ns/call
106
10724073µs if ($ENV{EVAL_CLOSURE_PRINT_SOURCE}) {
108 _dump_source(_make_compiler_source($source, @capture_keys));
109 }
110
111240351µs24035.1ms my ($compiler, $e) = _make_compiler($source, @capture_keys);
# spent 35.1ms making 240 calls to Eval::Closure::_make_compiler, avg 146µs/call
1122403µs my $code;
113240419µs240735µs if (defined $compiler) {
# spent 14µs making 1 call to Eval::Closure::Sandbox_239::__ANON__[(eval 331)[Eval/Closure.pm:135]:222] # spent 6µs making 1 call to Eval::Closure::Sandbox_21::__ANON__[(eval 94)[Eval/Closure.pm:135]:58] # spent 6µs making 1 call to Eval::Closure::Sandbox_31::__ANON__[(eval 104)[Eval/Closure.pm:135]:58] # spent 6µs making 1 call to Eval::Closure::Sandbox_38::__ANON__[(eval 111)[Eval/Closure.pm:135]:58] # spent 5µs making 1 call to Eval::Closure::Sandbox_238::__ANON__[(eval 330)[Eval/Closure.pm:135]:38] # spent 5µs making 1 call to Eval::Closure::Sandbox_233::__ANON__[(eval 325)[Eval/Closure.pm:135]:33] # spent 5µs making 1 call to Eval::Closure::Sandbox_231::__ANON__[(eval 323)[Eval/Closure.pm:135]:29] # spent 5µs making 1 call to Eval::Closure::Sandbox_234::__ANON__[(eval 326)[Eval/Closure.pm:135]:26] # spent 5µs making 1 call to Eval::Closure::Sandbox_236::__ANON__[(eval 328)[Eval/Closure.pm:135]:29] # spent 5µs making 1 call to Eval::Closure::Sandbox_189::__ANON__[(eval 281)[Eval/Closure.pm:135]:29] # spent 5µs making 1 call to Eval::Closure::Sandbox_207::__ANON__[(eval 299)[Eval/Closure.pm:135]:29] # spent 4µs making 1 call to Eval::Closure::Sandbox_118::__ANON__[(eval 209)[Eval/Closure.pm:135]:142] # spent 4µs making 1 call to Eval::Closure::Sandbox_205::__ANON__[(eval 297)[Eval/Closure.pm:135]:27] # spent 4µs making 1 call to Eval::Closure::Sandbox_213::__ANON__[(eval 305)[Eval/Closure.pm:135]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_215::__ANON__[(eval 307)[Eval/Closure.pm:135]:27] # spent 4µs making 1 call to Eval::Closure::Sandbox_217::__ANON__[(eval 309)[Eval/Closure.pm:135]:29] # spent 4µs making 1 call to Eval::Closure::Sandbox_235::__ANON__[(eval 327)[Eval/Closure.pm:135]:23] # spent 4µs making 1 call to Eval::Closure::Sandbox_237::__ANON__[(eval 329)[Eval/Closure.pm:135]:23] # spent 4µs making 1 call to Eval::Closure::Sandbox_103::__ANON__[(eval 194)[Eval/Closure.pm:135]:133] # spent 4µs making 1 call to Eval::Closure::Sandbox_187::__ANON__[(eval 279)[Eval/Closure.pm:135]:27] # spent 4µs making 1 call to Eval::Closure::Sandbox_203::__ANON__[(eval 295)[Eval/Closure.pm:135]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_204::__ANON__[(eval 296)[Eval/Closure.pm:135]:21] # spent 4µs making 1 call to Eval::Closure::Sandbox_210::__ANON__[(eval 302)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_230::__ANON__[(eval 322)[Eval/Closure.pm:135]:26] # spent 4µs making 1 call to Eval::Closure::Sandbox_232::__ANON__[(eval 324)[Eval/Closure.pm:135]:23] # spent 4µs making 1 call to Eval::Closure::Sandbox_109::__ANON__[(eval 200)[Eval/Closure.pm:135]:100] # spent 4µs making 1 call to Eval::Closure::Sandbox_184::__ANON__[(eval 276)[Eval/Closure.pm:135]:21] # spent 4µs making 1 call to Eval::Closure::Sandbox_186::__ANON__[(eval 278)[Eval/Closure.pm:135]:21] # spent 4µs making 1 call to Eval::Closure::Sandbox_202::__ANON__[(eval 294)[Eval/Closure.pm:135]:21] # spent 4µs making 1 call to Eval::Closure::Sandbox_214::__ANON__[(eval 306)[Eval/Closure.pm:135]:21] # spent 4µs making 1 call to Eval::Closure::Sandbox_185::__ANON__[(eval 277)[Eval/Closure.pm:135]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_188::__ANON__[(eval 280)[Eval/Closure.pm:135]:20] # spent 4µs making 1 call to Eval::Closure::Sandbox_206::__ANON__[(eval 298)[Eval/Closure.pm:135]:20] # spent 4µs making 1 call to Eval::Closure::Sandbox_212::__ANON__[(eval 304)[Eval/Closure.pm:135]:21] # spent 4µs making 1 call to Eval::Closure::Sandbox_70::__ANON__[(eval 161)[Eval/Closure.pm:135]:100] # spent 4µs making 1 call to Eval::Closure::Sandbox_77::__ANON__[(eval 168)[Eval/Closure.pm:135]:106] # spent 4µs making 1 call to Eval::Closure::Sandbox_201::__ANON__[(eval 293)[Eval/Closure.pm:135]:32] # spent 4µs making 1 call to Eval::Closure::Sandbox_216::__ANON__[(eval 308)[Eval/Closure.pm:135]:20] # spent 4µs making 1 call to Eval::Closure::Sandbox_191::__ANON__[(eval 283)[Eval/Closure.pm:135]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_195::__ANON__[(eval 287)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_198::__ANON__[(eval 290)[Eval/Closure.pm:135]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_199::__ANON__[(eval 291)[Eval/Closure.pm:135]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_220::__ANON__[(eval 312)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_222::__ANON__[(eval 314)[Eval/Closure.pm:135]:38] # spent 4µs making 1 call to Eval::Closure::Sandbox_224::__ANON__[(eval 316)[Eval/Closure.pm:135]:38] # spent 4µs making 1 call to Eval::Closure::Sandbox_192::__ANON__[(eval 284)[Eval/Closure.pm:135]:38] # spent 4µs making 1 call to Eval::Closure::Sandbox_19::__ANON__[(eval 92)[Eval/Closure.pm:135]:52] # spent 4µs making 1 call to Eval::Closure::Sandbox_209::__ANON__[(eval 301)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_218::__ANON__[(eval 310)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_26::__ANON__[(eval 99)[Eval/Closure.pm:135]:58] # spent 4µs making 1 call to Eval::Closure::Sandbox_33::__ANON__[(eval 106)[Eval/Closure.pm:135]:55] # spent 4µs making 1 call to Eval::Closure::Sandbox_35::__ANON__[(eval 108)[Eval/Closure.pm:135]:55] # spent 4µs making 1 call to Eval::Closure::Sandbox_121::__ANON__[(eval 212)[Eval/Closure.pm:135]:25] # spent 4µs making 1 call to Eval::Closure::Sandbox_166::__ANON__[(eval 258)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_196::__ANON__[(eval 288)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_40::__ANON__[(eval 113)[Eval/Closure.pm:135]:55] # spent 4µs making 1 call to Eval::Closure::Sandbox_170::__ANON__[(eval 262)[Eval/Closure.pm:135]:15] # spent 4µs making 1 call to Eval::Closure::Sandbox_171::__ANON__[(eval 263)[Eval/Closure.pm:135]:25] # spent 4µs making 1 call to Eval::Closure::Sandbox_197::__ANON__[(eval 289)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_208::__ANON__[(eval 300)[Eval/Closure.pm:135]:15] # spent 4µs making 1 call to Eval::Closure::Sandbox_78::__ANON__[(eval 169)[Eval/Closure.pm:135]:25] # spent 4µs making 1 call to Eval::Closure::Sandbox_85::__ANON__[(eval 176)[Eval/Closure.pm:135]:46] # spent 4µs making 1 call to Eval::Closure::Sandbox_86::__ANON__[(eval 177)[Eval/Closure.pm:135]:40] # spent 4µs making 1 call to Eval::Closure::Sandbox_126::__ANON__[(eval 217)[Eval/Closure.pm:135]:31] # spent 4µs making 1 call to Eval::Closure::Sandbox_127::__ANON__[(eval 218)[Eval/Closure.pm:135]:25] # spent 4µs making 1 call to Eval::Closure::Sandbox_129::__ANON__[(eval 220)[Eval/Closure.pm:135]:31] # spent 4µs making 1 call to Eval::Closure::Sandbox_161::__ANON__[(eval 253)[Eval/Closure.pm:135]:14] # spent 4µs making 1 call to Eval::Closure::Sandbox_200::__ANON__[(eval 292)[Eval/Closure.pm:135]:14] # spent 4µs making 1 call to Eval::Closure::Sandbox_82::__ANON__[(eval 173)[Eval/Closure.pm:135]:27] # spent 4µs making 1 call to Eval::Closure::Sandbox_84::__ANON__[(eval 175)[Eval/Closure.pm:135]:28] # spent 4µs making 1 call to Eval::Closure::Sandbox_87::__ANON__[(eval 178)[Eval/Closure.pm:135]:28] # spent 3µs making 1 call to Eval::Closure::Sandbox_123::__ANON__[(eval 214)[Eval/Closure.pm:135]:31] # spent 3µs making 1 call to Eval::Closure::Sandbox_163::__ANON__[(eval 255)[Eval/Closure.pm:135]:14] # spent 3µs making 1 call to Eval::Closure::Sandbox_83::__ANON__[(eval 174)[Eval/Closure.pm:135]:27] # spent 3µs making 1 call to Eval::Closure::Sandbox_88::__ANON__[(eval 179)[Eval/Closure.pm:135]:28] # spent 3µs making 1 call to Eval::Closure::Sandbox_110::__ANON__[(eval 201)[Eval/Closure.pm:135]:28] # spent 3µs making 1 call to Eval::Closure::Sandbox_112::__ANON__[(eval 203)[Eval/Closure.pm:135]:16] # spent 3µs making 1 call to Eval::Closure::Sandbox_114::__ANON__[(eval 205)[Eval/Closure.pm:135]:19] # spent 3µs making 1 call to Eval::Closure::Sandbox_158::__ANON__[(eval 250)[Eval/Closure.pm:135]:12] # spent 3µs making 1 call to Eval::Closure::Sandbox_160::__ANON__[(eval 252)[Eval/Closure.pm:135]:12] # spent 3µs making 1 call to Eval::Closure::Sandbox_194::__ANON__[(eval 286)[Eval/Closure.pm:135]:14] # spent 3µs making 1 call to Eval::Closure::Sandbox_45::__ANON__[(eval 118)[Eval/Closure.pm:135]:22] # spent 3µs making 1 call to Eval::Closure::Sandbox_223::__ANON__[(eval 315)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_67::__ANON__[(eval 143)[Eval/Closure.pm:135]:10] # spent 3µs making 1 call to Eval::Closure::Sandbox_162::__ANON__[(eval 254)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_193::__ANON__[(eval 285)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_219::__ANON__[(eval 311)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_225::__ANON__[(eval 317)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_79::__ANON__[(eval 170)[Eval/Closure.pm:135]:10] # spent 3µs making 1 call to Eval::Closure::Sandbox_159::__ANON__[(eval 251)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_167::__ANON__[(eval 259)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_190::__ANON__[(eval 282)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_211::__ANON__[(eval 303)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_221::__ANON__[(eval 313)[Eval/Closure.pm:135]:8] # spent 3µs making 1 call to Eval::Closure::Sandbox_181::__ANON__[(eval 273)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_228::__ANON__[(eval 320)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_90::__ANON__[(eval 181)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_91::__ANON__[(eval 182)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_92::__ANON__[(eval 183)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_122::__ANON__[(eval 213)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_152::__ANON__[(eval 244)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_32::__ANON__[(eval 105)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_44::__ANON__[(eval 117)[Eval/Closure.pm:135]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_62::__ANON__[(eval 135)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_71::__ANON__[(eval 162)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_101::__ANON__[(eval 192)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_104::__ANON__[(eval 195)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_107::__ANON__[(eval 198)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_113::__ANON__[(eval 204)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_119::__ANON__[(eval 210)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_139::__ANON__[(eval 230)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_150::__ANON__[(eval 242)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_172::__ANON__[(eval 264)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_20::__ANON__[(eval 93)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_22::__ANON__[(eval 95)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_23::__ANON__[(eval 96)[Eval/Closure.pm:135]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_240::__ANON__[(eval 332)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_27::__ANON__[(eval 100)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_34::__ANON__[(eval 107)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_39::__ANON__[(eval 112)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_3::__ANON__[(eval 76)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_53::__ANON__[(eval 126)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_59::__ANON__[(eval 132)[Eval/Closure.pm:135]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_5::__ANON__[(eval 78)[Eval/Closure.pm:135]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_73::__ANON__[(eval 164)[Eval/Closure.pm:135]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_89::__ANON__[(eval 180)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_102::__ANON__[(eval 193)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_105::__ANON__[(eval 196)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_106::__ANON__[(eval 197)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_108::__ANON__[(eval 199)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_116::__ANON__[(eval 207)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_11::__ANON__[(eval 84)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_124::__ANON__[(eval 215)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_125::__ANON__[(eval 216)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_128::__ANON__[(eval 219)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_130::__ANON__[(eval 221)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_135::__ANON__[(eval 226)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_137::__ANON__[(eval 228)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_13::__ANON__[(eval 86)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_140::__ANON__[(eval 231)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_143::__ANON__[(eval 234)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_146::__ANON__[(eval 237)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_153::__ANON__[(eval 245)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_154::__ANON__[(eval 246)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_157::__ANON__[(eval 249)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_15::__ANON__[(eval 88)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_165::__ANON__[(eval 257)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_175::__ANON__[(eval 267)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_176::__ANON__[(eval 268)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_178::__ANON__[(eval 270)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_17::__ANON__[(eval 90)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_182::__ANON__[(eval 274)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_1::__ANON__[(eval 74)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_226::__ANON__[(eval 318)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_24::__ANON__[(eval 97)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_29::__ANON__[(eval 102)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_36::__ANON__[(eval 109)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_37::__ANON__[(eval 110)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_41::__ANON__[(eval 114)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_42::__ANON__[(eval 115)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_4::__ANON__[(eval 77)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_55::__ANON__[(eval 128)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_72::__ANON__[(eval 163)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_75::__ANON__[(eval 166)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_81::__ANON__[(eval 172)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_93::__ANON__[(eval 184)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_94::__ANON__[(eval 185)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_95::__ANON__[(eval 186)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_96::__ANON__[(eval 187)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_97::__ANON__[(eval 188)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_98::__ANON__[(eval 189)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_99::__ANON__[(eval 190)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_100::__ANON__[(eval 191)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_10::__ANON__[(eval 83)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_111::__ANON__[(eval 202)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_115::__ANON__[(eval 206)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_120::__ANON__[(eval 211)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_131::__ANON__[(eval 222)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_132::__ANON__[(eval 223)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_133::__ANON__[(eval 224)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_134::__ANON__[(eval 225)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_138::__ANON__[(eval 229)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_141::__ANON__[(eval 232)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_144::__ANON__[(eval 235)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_148::__ANON__[(eval 239)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_149::__ANON__[(eval 240)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_151::__ANON__[(eval 243)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_155::__ANON__[(eval 247)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_168::__ANON__[(eval 260)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_173::__ANON__[(eval 265)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_174::__ANON__[(eval 266)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_177::__ANON__[(eval 269)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_179::__ANON__[(eval 271)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_18::__ANON__[(eval 91)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_229::__ANON__[(eval 321)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_25::__ANON__[(eval 98)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_28::__ANON__[(eval 101)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_2::__ANON__[(eval 75)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_43::__ANON__[(eval 116)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_50::__ANON__[(eval 123)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_57::__ANON__[(eval 130)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_68::__ANON__[(eval 159)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_69::__ANON__[(eval 160)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_6::__ANON__[(eval 79)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_74::__ANON__[(eval 165)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_76::__ANON__[(eval 167)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_7::__ANON__[(eval 80)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_80::__ANON__[(eval 171)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_8::__ANON__[(eval 81)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_117::__ANON__[(eval 208)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_12::__ANON__[(eval 85)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_136::__ANON__[(eval 227)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_142::__ANON__[(eval 233)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_145::__ANON__[(eval 236)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_147::__ANON__[(eval 238)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_156::__ANON__[(eval 248)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_164::__ANON__[(eval 256)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_169::__ANON__[(eval 261)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_16::__ANON__[(eval 89)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_180::__ANON__[(eval 272)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_183::__ANON__[(eval 275)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_227::__ANON__[(eval 319)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_30::__ANON__[(eval 103)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_54::__ANON__[(eval 127)[Eval/Closure.pm:135]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_60::__ANON__[(eval 133)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_61::__ANON__[(eval 134)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_63::__ANON__[(eval 136)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_9::__ANON__[(eval 82)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_14::__ANON__[(eval 87)[Eval/Closure.pm:135]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_47::__ANON__[(eval 120)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_46::__ANON__[(eval 119)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_48::__ANON__[(eval 121)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_49::__ANON__[(eval 122)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_58::__ANON__[(eval 131)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_66::__ANON__[(eval 139)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_51::__ANON__[(eval 124)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_52::__ANON__[(eval 125)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_56::__ANON__[(eval 129)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_64::__ANON__[(eval 137)[Eval/Closure.pm:135]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_65::__ANON__[(eval 138)[Eval/Closure.pm:135]:4]
114 $code = $compiler->(@$captures{@capture_keys});
115 }
116
117240130µs if (defined($code) && (!ref($code) || ref($code) ne 'CODE')) {
118 $e = "The 'source' parameter must return a subroutine reference, "
119 . "not $code";
120 undef $code;
121 }
122
123240471µs return ($code, $e);
124}
125
126
# spent 35.1ms (1.34+33.7) within Eval::Closure::_make_compiler which was called 240 times, avg 146µs/call: # 240 times (1.34ms+33.7ms) by Eval::Closure::_clean_eval_closure at line 111, avg 146µs/call
sub _make_compiler {
127240219µs2401.75ms my $source = _make_compiler_source(@_);
# spent 1.75ms making 240 calls to Eval::Closure::_make_compiler_source, avg 7µs/call
128
129240596µs24032.0ms return @{ _clean_eval($source) };
# spent 32.0ms making 240 calls to Eval::Closure::_clean_eval, avg 133µs/call
130}
131
132
# spent 32.0ms within Eval::Closure::_clean_eval which was called 240 times, avg 133µs/call: # 240 times (32.0ms+0s) by Eval::Closure::_make_compiler at line 129, avg 133µs/call
sub _clean_eval {
13324024µs local $@;
134240320µs local $SIG{__DIE__};
13524029.8ms my $compiler = eval $_[0];
# spent 8.48s executing statements in 240 string evals (merged)
# includes 256ms spent executing 350244 calls to 496 subs defined therein.
13624034µs my $e = $@;
137240983µs [ $compiler, $e ];
138}
139
1401100ns$Eval::Closure::SANDBOX_ID = 0;
141
142
# spent 1.75ms (1.17+575µs) within Eval::Closure::_make_compiler_source which was called 240 times, avg 7µs/call: # 240 times (1.17ms+575µs) by Eval::Closure::_make_compiler at line 127, avg 7µs/call
sub _make_compiler_source {
14324076µs my ($source, @capture_keys) = @_;
14424024µs $Eval::Closure::SANDBOX_ID++;
14524024µs my $i = 0;
146225162µs225575µs return join "\n", (
# spent 575µs making 225 calls to Eval::Closure::_make_lexical_assignment, avg 3µs/call
147 "package Eval::Closure::Sandbox_$Eval::Closure::SANDBOX_ID;",
148 'sub {',
149240734µs (map { _make_lexical_assignment($_, $i++) } @capture_keys),
150 $source,
151 '}',
152 );
153}
154
155
# spent 575µs within Eval::Closure::_make_lexical_assignment which was called 225 times, avg 3µs/call: # 225 times (575µs+0s) by Eval::Closure::_make_compiler_source at line 146, avg 3µs/call
sub _make_lexical_assignment {
15622532µs my ($key, $index) = @_;
15722563µs my $sigil = substr($key, 0, 1);
15822534µs my $name = substr($key, 1);
15922533µs if (HAS_LEXICAL_SUBS && $sigil eq '&') {
160 my $tmpname = '$__' . $name . '__' . $index;
161 return 'use feature "lexical_subs"; '
162 . 'no warnings "experimental::lexical_subs"; '
163 . 'my ' . $tmpname . ' = $_[' . $index . ']; '
164 . 'my sub ' . $name . ' { goto ' . $tmpname . ' }';
165 }
166 else {
167225448µs return 'my ' . $key . ' = ' . $sigil . '{$_[' . $index . ']};';
168 }
169}
170
171sub _dump_source {
172 my ($source) = @_;
173
174 my $output;
175 if (try { require Perl::Tidy }) {
176 Perl::Tidy::perltidy(
177 source => \$source,
178 destination => \$output,
179 argv => [],
180 );
181 }
182 else {
183 $output = $source;
184 }
185
186 warn "$output\n";
187}
188
189
19014µs1;
191
192__END__
 
# spent 138µs within Eval::Closure::CORE:match which was called 225 times, avg 613ns/call: # 225 times (138µs+0s) by Eval::Closure::_validate_env at line 82, avg 613ns/call
sub Eval::Closure::CORE:match; # opcode
# spent 111µs within Eval::Closure::CORE:sort which was called 240 times, avg 461ns/call: # 240 times (111µs+0s) by Eval::Closure::_clean_eval_closure at line 105, avg 461ns/call
sub Eval::Closure::CORE:sort; # opcode