← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 10:04:38 2014
Reported on Tue Jun 24 10:05:29 2014

Filename/usr/local/share/perl/5.14.2/Eval/Closure.pm
StatementsExecuted 11079 statements in 49.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2411135.4ms35.4msEval::Closure::::_clean_evalEval::Closure::_clean_eval
241113.44ms44.1msEval::Closure::::_clean_eval_closureEval::Closure::_clean_eval_closure
241223.01ms50.5msEval::Closure::::eval_closureEval::Closure::eval_closure
241111.61ms39.3msEval::Closure::::_make_compilerEval::Closure::_make_compiler
241111.56ms2.23msEval::Closure::::_make_compiler_sourceEval::Closure::_make_compiler_source
241111.50ms1.87msEval::Closure::::_validate_envEval::Closure::_validate_env
241111.40ms1.55msEval::Closure::::_canonicalize_sourceEval::Closure::_canonicalize_source
21611670µs670µsEval::Closure::::_make_lexical_assignmentEval::Closure::_make_lexical_assignment
24111312µs312µsEval::Closure::::CORE:sortEval::Closure::CORE:sort (opcode)
21611237µs237µsEval::Closure::::CORE:matchEval::Closure::CORE:match (opcode)
11117µs38µsEval::Closure::::BEGIN@17Eval::Closure::BEGIN@17
11110µs10µsEval::Closure::::BEGIN@2Eval::Closure::BEGIN@2
1117µs37µsEval::Closure::::BEGIN@20Eval::Closure::BEGIN@20
1117µs38µsEval::Closure::::BEGIN@18Eval::Closure::BEGIN@18
1116µs39µsEval::Closure::::BEGIN@15Eval::Closure::BEGIN@15
1116µs9µsEval::Closure::::BEGIN@8Eval::Closure::BEGIN@8
1116µs10µsEval::Closure::::BEGIN@9Eval::Closure::BEGIN@9
1116µs13µsEval::Closure::::BEGIN@12Eval::Closure::BEGIN@12
1114µs4µsEval::Closure::::BEGIN@16Eval::Closure::BEGIN@16
0000s0sEval::Closure::::__ANON__[:187]Eval::Closure::__ANON__[:187]
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 10µs within Eval::Closure::BEGIN@2 which was called: # once (10µs+0s) by Class::MOP::Method::Generated::BEGIN@14 at line 4
BEGIN {
315µs $Eval::Closure::AUTHORITY = 'cpan:DOY';
4126µs110µs}
# spent 10µs making 1 call to Eval::Closure::BEGIN@2
5{
621µs $Eval::Closure::VERSION = '0.11';
7}
8220µs212µs
# spent 9µs (6+3) within Eval::Closure::BEGIN@8 which was called: # once (6µs+3µs) by Class::MOP::Method::Generated::BEGIN@14 at line 8
use strict;
# spent 9µs making 1 call to Eval::Closure::BEGIN@8 # spent 3µs making 1 call to strict::import
9221µs215µs
# spent 10µs (6+4) within Eval::Closure::BEGIN@9 which was called: # once (6µs+4µs) by Class::MOP::Method::Generated::BEGIN@14 at line 9
use warnings;
# spent 10µs making 1 call to Eval::Closure::BEGIN@9 # spent 4µs making 1 call to warnings::import
10# ABSTRACT: safely and cleanly create closures via string eval
11
12236µs219µs
# spent 13µs (6+7) within Eval::Closure::BEGIN@12 which was called: # once (6µs+7µs) by Class::MOP::Method::Generated::BEGIN@14 at line 12
use Exporter 'import';
# spent 13µs making 1 call to Eval::Closure::BEGIN@12 # spent 7µs making 1 call to Exporter::import
1311µs@Eval::Closure::EXPORT = @Eval::Closure::EXPORT_OK = 'eval_closure';
14
15221µs271µs
# spent 39µs (6+32) within Eval::Closure::BEGIN@15 which was called: # once (6µs+32µs) by Class::MOP::Method::Generated::BEGIN@14 at line 15
use Carp;
# spent 39µs making 1 call to Eval::Closure::BEGIN@15 # spent 32µs making 1 call to Exporter::import
16220µs14µs
# spent 4µs within Eval::Closure::BEGIN@16 which was called: # once (4µs+0s) by Class::MOP::Method::Generated::BEGIN@14 at line 16
use overload ();
# spent 4µs making 1 call to Eval::Closure::BEGIN@16
17223µs259µs
# spent 38µs (17+21) within Eval::Closure::BEGIN@17 which was called: # once (17µs+21µs) by Class::MOP::Method::Generated::BEGIN@14 at line 17
use Scalar::Util qw(reftype);
# spent 38µs making 1 call to Eval::Closure::BEGIN@17 # spent 21µs making 1 call to Exporter::import
18232µs269µs
# spent 38µs (7+31) within Eval::Closure::BEGIN@18 which was called: # once (7µs+31µs) by Class::MOP::Method::Generated::BEGIN@14 at line 18
use Try::Tiny;
# spent 38µs making 1 call to Eval::Closure::BEGIN@18 # spent 31µs making 1 call to Exporter::import
19
202869µs267µs
# spent 37µs (7+30) within Eval::Closure::BEGIN@20 which was called: # once (7µs+30µs) by Class::MOP::Method::Generated::BEGIN@14 at line 20
use constant HAS_LEXICAL_SUBS => $] >= 5.018;
# spent 37µs making 1 call to Eval::Closure::BEGIN@20 # spent 30µs making 1 call to constant::import
21
- -
24
# spent 50.5ms (3.01+47.5) within Eval::Closure::eval_closure which was called 241 times, avg 210µs/call: # 196 times (2.50ms+41.5ms) by Class::MOP::Method::Generated::_compile_code at line 63 of Class/MOP/Method/Generated.pm, avg 224µs/call # 45 times (507µs+6.02ms) by Moose::Meta::TypeConstraint::_actually_compile_type_constraint at line 312 of Moose/Meta/TypeConstraint.pm, avg 145µs/call
sub eval_closure {
25241347µs my (%args) = @_;
26
27 # default to copying environment
28241178µs $args{alias} = 0 if !exists $args{alias};
29
30241340µs2411.55ms $args{source} = _canonicalize_source($args{source});
# spent 1.55ms making 241 calls to Eval::Closure::_canonicalize_source, avg 6µs/call
31241335µs2411.87ms _validate_env($args{environment} ||= {});
# spent 1.87ms making 241 calls to Eval::Closure::_validate_env, avg 8µs/call
32
33241270µs $args{source} = _line_directive(@args{qw(line description)})
34 . $args{source}
35 if defined $args{description} && !($^P & 0x10);
36
37241456µs24144.1ms my ($code, $e) = _clean_eval_closure(@args{qw(source environment alias)});
# spent 44.1ms making 241 calls to Eval::Closure::_clean_eval_closure, avg 183µs/call
38
3924150µs if (!$code) {
40 if ($args{terse_error}) {
41 die "$e\n";
42 }
43 else {
44 croak("Failed to compile source: $e\n\nsource:\n$args{source}")
45 }
46 }
47
48241655µs return $code;
49}
50
51
# spent 1.55ms (1.40+151µs) within Eval::Closure::_canonicalize_source which was called 241 times, avg 6µs/call: # 241 times (1.40ms+151µs) by Eval::Closure::eval_closure at line 30, avg 6µs/call
sub _canonicalize_source {
5224196µs my ($source) = @_;
53
5424147µs if (defined($source)) {
5524173µs if (ref($source)) {
56196564µs196151µs if (reftype($source) eq 'ARRAY'
# spent 151µs making 196 calls to Scalar::Util::reftype, avg 770ns/call
57 || overload::Method($source, '@{}')) {
58196870µs return join "\n", @$source;
59 }
60 elsif (overload::Method($source, '""')) {
61 return "$source";
62 }
63 else {
64 croak("The 'source' parameter to eval_closure must be a "
65 . "string or array reference");
66 }
67 }
68 else {
694597µs return $source;
70 }
71 }
72 else {
73 croak("The 'source' parameter to eval_closure is required");
74 }
75}
76
77
# spent 1.87ms (1.50+371µs) within Eval::Closure::_validate_env which was called 241 times, avg 8µs/call: # 241 times (1.50ms+371µs) by Eval::Closure::eval_closure at line 31, avg 8µs/call
sub _validate_env {
7824187µs my ($env) = @_;
79
80241509µs241134µs croak("The 'environment' parameter must be a hashref")
# spent 134µs making 241 calls to Scalar::Util::reftype, avg 554ns/call
81 unless reftype($env) eq 'HASH';
82
83241682µs for my $var (keys %$env) {
8421642µs if (HAS_LEXICAL_SUBS) {
85 croak("Environment key '$var' should start with \@, \%, \$, or \&")
86 unless $var =~ /^([\@\%\$\&])/;
87 }
88 else {
89216546µs216237µs croak("Environment key '$var' should start with \@, \%, or \$")
# spent 237µs making 216 calls to Eval::Closure::CORE:match, avg 1µs/call
90 unless $var =~ /^([\@\%\$])/;
91 }
92216160µs croak("Environment values must be references, not $env->{$var}")
93 unless ref($env->{$var});
94 }
95}
96
97sub _line_directive {
98 my ($line, $description) = @_;
99
100 $line = 1 unless defined($line);
101
102 return qq{#line $line "$description"\n};
103}
104
105
# spent 44.1ms (3.44+40.6) within Eval::Closure::_clean_eval_closure which was called 241 times, avg 183µs/call: # 241 times (3.44ms+40.6ms) by Eval::Closure::eval_closure at line 37, avg 183µs/call
sub _clean_eval_closure {
106241197µs my ($source, $captures, $alias) = @_;
107
108241862µs241312µs my @capture_keys = sort keys %$captures;
# spent 312µs making 241 calls to Eval::Closure::CORE:sort, avg 1µs/call
109
110241122µs if ($ENV{EVAL_CLOSURE_PRINT_SOURCE}) {
111 _dump_source(_make_compiler_source($source, $alias, @capture_keys));
112 }
113
114241438µs24139.3ms my ($compiler, $e) = _make_compiler($source, $alias, @capture_keys);
# spent 39.3ms making 241 calls to Eval::Closure::_make_compiler, avg 163µs/call
11524124µs my $code;
116241135µs if (defined $compiler) {
117241521µs2411.06ms $code = $compiler->(@$captures{@capture_keys});
# spent 36µs making 1 call to Eval::Closure::Sandbox_194::__ANON__[(eval 260)[Eval/Closure.pm:144]:317] # spent 25µs making 1 call to Eval::Closure::Sandbox_167::__ANON__[(eval 233)[Eval/Closure.pm:144]:195] # spent 17µs making 1 call to Eval::Closure::Sandbox_170::__ANON__[(eval 236)[Eval/Closure.pm:144]:11] # spent 15µs making 1 call to Eval::Closure::Sandbox_147::__ANON__[(eval 210)[Eval/Closure.pm:144]:9] # spent 15µs making 1 call to Eval::Closure::Sandbox_150::__ANON__[(eval 213)[Eval/Closure.pm:144]:4] # spent 11µs making 1 call to Eval::Closure::Sandbox_221::__ANON__[(eval 289)[Eval/Closure.pm:144]:65] # spent 11µs making 1 call to Eval::Closure::Sandbox_216::__ANON__[(eval 284)[Eval/Closure.pm:144]:58] # spent 10µs making 1 call to Eval::Closure::Sandbox_236::__ANON__[(eval 304)[Eval/Closure.pm:144]:34] # spent 10µs making 1 call to Eval::Closure::Sandbox_38::__ANON__[(eval 99)[Eval/Closure.pm:144]:58] # spent 9µs making 1 call to Eval::Closure::Sandbox_103::__ANON__[(eval 166)[Eval/Closure.pm:144]:133] # spent 9µs making 1 call to Eval::Closure::Sandbox_118::__ANON__[(eval 181)[Eval/Closure.pm:144]:142] # spent 8µs making 1 call to Eval::Closure::Sandbox_109::__ANON__[(eval 172)[Eval/Closure.pm:144]:100] # spent 8µs making 1 call to Eval::Closure::Sandbox_70::__ANON__[(eval 133)[Eval/Closure.pm:144]:100] # spent 8µs making 1 call to Eval::Closure::Sandbox_77::__ANON__[(eval 140)[Eval/Closure.pm:144]:106] # spent 7µs making 1 call to Eval::Closure::Sandbox_182::__ANON__[(eval 248)[Eval/Closure.pm:144]:18] # spent 7µs making 1 call to Eval::Closure::Sandbox_31::__ANON__[(eval 92)[Eval/Closure.pm:144]:58] # spent 7µs making 1 call to Eval::Closure::Sandbox_21::__ANON__[(eval 82)[Eval/Closure.pm:144]:58] # spent 7µs making 1 call to Eval::Closure::Sandbox_40::__ANON__[(eval 101)[Eval/Closure.pm:144]:55] # spent 7µs making 1 call to Eval::Closure::Sandbox_211::__ANON__[(eval 279)[Eval/Closure.pm:144]:25] # spent 7µs making 1 call to Eval::Closure::Sandbox_33::__ANON__[(eval 94)[Eval/Closure.pm:144]:55] # spent 6µs making 1 call to Eval::Closure::Sandbox_162::__ANON__[(eval 228)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_26::__ANON__[(eval 87)[Eval/Closure.pm:144]:58] # spent 6µs making 1 call to Eval::Closure::Sandbox_19::__ANON__[(eval 80)[Eval/Closure.pm:144]:52] # spent 6µs making 1 call to Eval::Closure::Sandbox_208::__ANON__[(eval 276)[Eval/Closure.pm:144]:25] # spent 6µs making 1 call to Eval::Closure::Sandbox_88::__ANON__[(eval 151)[Eval/Closure.pm:144]:28] # spent 6µs making 1 call to Eval::Closure::Sandbox_35::__ANON__[(eval 96)[Eval/Closure.pm:144]:55] # spent 6µs making 1 call to Eval::Closure::Sandbox_220::__ANON__[(eval 288)[Eval/Closure.pm:144]:25] # spent 6µs making 1 call to Eval::Closure::Sandbox_86::__ANON__[(eval 149)[Eval/Closure.pm:144]:40] # spent 6µs making 1 call to Eval::Closure::Sandbox_229::__ANON__[(eval 297)[Eval/Closure.pm:144]:22] # spent 6µs making 1 call to Eval::Closure::Sandbox_78::__ANON__[(eval 141)[Eval/Closure.pm:144]:25] # spent 6µs making 1 call to Eval::Closure::Sandbox_188::__ANON__[(eval 254)[Eval/Closure.pm:144]:13] # spent 6µs making 1 call to Eval::Closure::Sandbox_152::__ANON__[(eval 218)[Eval/Closure.pm:144]:18] # spent 6µs making 1 call to Eval::Closure::Sandbox_228::__ANON__[(eval 296)[Eval/Closure.pm:144]:22] # spent 6µs making 1 call to Eval::Closure::Sandbox_85::__ANON__[(eval 148)[Eval/Closure.pm:144]:46] # spent 6µs making 1 call to Eval::Closure::Sandbox_184::__ANON__[(eval 250)[Eval/Closure.pm:144]:18] # spent 6µs making 1 call to Eval::Closure::Sandbox_155::__ANON__[(eval 221)[Eval/Closure.pm:144]:11] # spent 6µs making 1 call to Eval::Closure::Sandbox_163::__ANON__[(eval 229)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_164::__ANON__[(eval 230)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_165::__ANON__[(eval 231)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_173::__ANON__[(eval 239)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_191::__ANON__[(eval 257)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_183::__ANON__[(eval 249)[Eval/Closure.pm:144]:18] # spent 6µs making 1 call to Eval::Closure::Sandbox_205::__ANON__[(eval 273)[Eval/Closure.pm:144]:12] # spent 6µs making 1 call to Eval::Closure::Sandbox_232::__ANON__[(eval 300)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_166::__ANON__[(eval 232)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_175::__ANON__[(eval 241)[Eval/Closure.pm:144]:15] # spent 6µs making 1 call to Eval::Closure::Sandbox_83::__ANON__[(eval 146)[Eval/Closure.pm:144]:27] # spent 5µs making 1 call to Eval::Closure::Sandbox_159::__ANON__[(eval 225)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_160::__ANON__[(eval 226)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_161::__ANON__[(eval 227)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_193::__ANON__[(eval 259)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_231::__ANON__[(eval 299)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_174::__ANON__[(eval 240)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_181::__ANON__[(eval 247)[Eval/Closure.pm:144]:14] # spent 5µs making 1 call to Eval::Closure::Sandbox_176::__ANON__[(eval 242)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_177::__ANON__[(eval 243)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_189::__ANON__[(eval 255)[Eval/Closure.pm:144]:15] # spent 5µs making 1 call to Eval::Closure::Sandbox_82::__ANON__[(eval 145)[Eval/Closure.pm:144]:27] # spent 5µs making 1 call to Eval::Closure::Sandbox_178::__ANON__[(eval 244)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_230::__ANON__[(eval 298)[Eval/Closure.pm:144]:14] # spent 5µs making 1 call to Eval::Closure::Sandbox_185::__ANON__[(eval 251)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_209::__ANON__[(eval 277)[Eval/Closure.pm:144]:8] # spent 5µs making 1 call to Eval::Closure::Sandbox_123::__ANON__[(eval 186)[Eval/Closure.pm:144]:31] # spent 5µs making 1 call to Eval::Closure::Sandbox_126::__ANON__[(eval 189)[Eval/Closure.pm:144]:31] # spent 5µs making 1 call to Eval::Closure::Sandbox_171::__ANON__[(eval 237)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_172::__ANON__[(eval 238)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_84::__ANON__[(eval 147)[Eval/Closure.pm:144]:28] # spent 5µs making 1 call to Eval::Closure::Sandbox_129::__ANON__[(eval 192)[Eval/Closure.pm:144]:31] # spent 5µs making 1 call to Eval::Closure::Sandbox_180::__ANON__[(eval 246)[Eval/Closure.pm:144]:14] # spent 5µs making 1 call to Eval::Closure::Sandbox_186::__ANON__[(eval 252)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_121::__ANON__[(eval 184)[Eval/Closure.pm:144]:25] # spent 5µs making 1 call to Eval::Closure::Sandbox_179::__ANON__[(eval 245)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_187::__ANON__[(eval 253)[Eval/Closure.pm:144]:12] # spent 5µs making 1 call to Eval::Closure::Sandbox_195::__ANON__[(eval 261)[Eval/Closure.pm:144]:11] # spent 5µs making 1 call to Eval::Closure::Sandbox_87::__ANON__[(eval 150)[Eval/Closure.pm:144]:28] # spent 5µs making 1 call to Eval::Closure::Sandbox_203::__ANON__[(eval 271)[Eval/Closure.pm:144]:11] # spent 5µs making 1 call to Eval::Closure::Sandbox_110::__ANON__[(eval 173)[Eval/Closure.pm:144]:28] # spent 5µs making 1 call to Eval::Closure::Sandbox_127::__ANON__[(eval 190)[Eval/Closure.pm:144]:25] # spent 5µs making 1 call to Eval::Closure::Sandbox_240::__ANON__[(eval 314)[Eval/Closure.pm:144]:11] # spent 5µs making 1 call to Eval::Closure::Sandbox_214::__ANON__[(eval 282)[Eval/Closure.pm:144]:11] # spent 5µs making 1 call to Eval::Closure::Sandbox_156::__ANON__[(eval 222)[Eval/Closure.pm:144]:11] # spent 5µs making 1 call to Eval::Closure::Sandbox_219::__ANON__[(eval 287)[Eval/Closure.pm:144]:11] # spent 5µs making 1 call to Eval::Closure::Sandbox_45::__ANON__[(eval 106)[Eval/Closure.pm:144]:22] # spent 4µs making 1 call to Eval::Closure::Sandbox_114::__ANON__[(eval 177)[Eval/Closure.pm:144]:19] # spent 4µs making 1 call to Eval::Closure::Sandbox_202::__ANON__[(eval 270)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_204::__ANON__[(eval 272)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_215::__ANON__[(eval 283)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_241::__ANON__[(eval 315)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_235::__ANON__[(eval 303)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_112::__ANON__[(eval 175)[Eval/Closure.pm:144]:16] # spent 4µs making 1 call to Eval::Closure::Sandbox_218::__ANON__[(eval 286)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_227::__ANON__[(eval 295)[Eval/Closure.pm:144]:13] # spent 4µs making 1 call to Eval::Closure::Sandbox_210::__ANON__[(eval 278)[Eval/Closure.pm:144]:8] # spent 4µs making 1 call to Eval::Closure::Sandbox_212::__ANON__[(eval 280)[Eval/Closure.pm:144]:8] # spent 4µs making 1 call to Eval::Closure::Sandbox_157::__ANON__[(eval 223)[Eval/Closure.pm:144]:13] # spent 4µs making 1 call to Eval::Closure::Sandbox_192::__ANON__[(eval 258)[Eval/Closure.pm:144]:11] # spent 4µs making 1 call to Eval::Closure::Sandbox_213::__ANON__[(eval 281)[Eval/Closure.pm:144]:8] # spent 4µs making 1 call to Eval::Closure::Sandbox_80::__ANON__[(eval 143)[Eval/Closure.pm:144]:10] # spent 4µs making 1 call to Eval::Closure::Sandbox_10::__ANON__[(eval 71)[Eval/Closure.pm:144]:9] # spent 4µs making 1 call to Eval::Closure::Sandbox_74::__ANON__[(eval 137)[Eval/Closure.pm:144]:9] # spent 4µs making 1 call to Eval::Closure::Sandbox_67::__ANON__[(eval 129)[Eval/Closure.pm:144]:10] # spent 4µs making 1 call to Eval::Closure::Sandbox_190::__ANON__[(eval 256)[Eval/Closure.pm:144]:10] # spent 4µs making 1 call to Eval::Closure::Sandbox_99::__ANON__[(eval 162)[Eval/Closure.pm:144]:9] # spent 4µs making 1 call to Eval::Closure::Sandbox_138::__ANON__[(eval 201)[Eval/Closure.pm:144]:9] # spent 4µs making 1 call to Eval::Closure::Sandbox_158::__ANON__[(eval 224)[Eval/Closure.pm:144]:10] # spent 4µs making 1 call to Eval::Closure::Sandbox_53::__ANON__[(eval 114)[Eval/Closure.pm:144]:4] # spent 4µs making 1 call to Eval::Closure::Sandbox_14::__ANON__[(eval 75)[Eval/Closure.pm:144]:6] # spent 4µs making 1 call to Eval::Closure::Sandbox_58::__ANON__[(eval 119)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_137::__ANON__[(eval 200)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_139::__ANON__[(eval 202)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_59::__ANON__[(eval 120)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_104::__ANON__[(eval 167)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_115::__ANON__[(eval 178)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_119::__ANON__[(eval 182)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_148::__ANON__[(eval 211)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_168::__ANON__[(eval 234)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_169::__ANON__[(eval 235)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_206::__ANON__[(eval 274)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_238::__ANON__[(eval 312)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_27::__ANON__[(eval 88)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_111::__ANON__[(eval 174)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_128::__ANON__[(eval 191)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_149::__ANON__[(eval 212)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_198::__ANON__[(eval 264)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_1::__ANON__[(eval 62)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_200::__ANON__[(eval 266)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_233::__ANON__[(eval 301)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_234::__ANON__[(eval 302)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_41::__ANON__[(eval 102)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_62::__ANON__[(eval 123)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_68::__ANON__[(eval 131)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_89::__ANON__[(eval 152)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_97::__ANON__[(eval 160)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_113::__ANON__[(eval 176)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_120::__ANON__[(eval 183)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_122::__ANON__[(eval 185)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_125::__ANON__[(eval 188)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_131::__ANON__[(eval 194)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_133::__ANON__[(eval 196)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_143::__ANON__[(eval 206)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_145::__ANON__[(eval 208)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_153::__ANON__[(eval 219)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_154::__ANON__[(eval 220)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_201::__ANON__[(eval 267)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_20::__ANON__[(eval 81)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_217::__ANON__[(eval 285)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_226::__ANON__[(eval 294)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_239::__ANON__[(eval 313)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_37::__ANON__[(eval 98)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_72::__ANON__[(eval 135)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_76::__ANON__[(eval 139)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_79::__ANON__[(eval 142)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_90::__ANON__[(eval 153)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_101::__ANON__[(eval 164)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_108::__ANON__[(eval 171)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_116::__ANON__[(eval 179)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_130::__ANON__[(eval 193)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_151::__ANON__[(eval 214)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_196::__ANON__[(eval 262)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_222::__ANON__[(eval 290)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_224::__ANON__[(eval 292)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_22::__ANON__[(eval 83)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_36::__ANON__[(eval 97)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_39::__ANON__[(eval 100)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_106::__ANON__[(eval 169)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_124::__ANON__[(eval 187)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_12::__ANON__[(eval 73)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_135::__ANON__[(eval 198)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_136::__ANON__[(eval 199)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_197::__ANON__[(eval 263)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_199::__ANON__[(eval 265)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_237::__ANON__[(eval 305)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_32::__ANON__[(eval 93)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_42::__ANON__[(eval 103)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_71::__ANON__[(eval 134)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_81::__ANON__[(eval 144)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_105::__ANON__[(eval 168)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_107::__ANON__[(eval 170)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_11::__ANON__[(eval 72)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_13::__ANON__[(eval 74)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_142::__ANON__[(eval 205)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_146::__ANON__[(eval 209)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_17::__ANON__[(eval 78)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_207::__ANON__[(eval 275)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_223::__ANON__[(eval 291)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_225::__ANON__[(eval 293)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_29::__ANON__[(eval 90)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_34::__ANON__[(eval 95)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_61::__ANON__[(eval 122)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_63::__ANON__[(eval 124)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_6::__ANON__[(eval 67)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_73::__ANON__[(eval 136)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_8::__ANON__[(eval 69)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_91::__ANON__[(eval 154)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_93::__ANON__[(eval 156)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_94::__ANON__[(eval 157)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_96::__ANON__[(eval 159)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_9::__ANON__[(eval 70)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_100::__ANON__[(eval 163)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_102::__ANON__[(eval 165)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_117::__ANON__[(eval 180)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_134::__ANON__[(eval 197)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_24::__ANON__[(eval 85)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_25::__ANON__[(eval 86)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_2::__ANON__[(eval 63)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_30::__ANON__[(eval 91)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_3::__ANON__[(eval 64)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_43::__ANON__[(eval 104)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_54::__ANON__[(eval 115)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_55::__ANON__[(eval 116)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_57::__ANON__[(eval 118)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_92::__ANON__[(eval 155)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_95::__ANON__[(eval 158)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_98::__ANON__[(eval 161)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_132::__ANON__[(eval 195)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_15::__ANON__[(eval 76)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_18::__ANON__[(eval 79)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_28::__ANON__[(eval 89)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_44::__ANON__[(eval 105)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_4::__ANON__[(eval 65)[Eval/Closure.pm:144]:6] # spent 3µs making 1 call to Eval::Closure::Sandbox_50::__ANON__[(eval 111)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_60::__ANON__[(eval 121)[Eval/Closure.pm:144]:4] # spent 3µs making 1 call to Eval::Closure::Sandbox_75::__ANON__[(eval 138)[Eval/Closure.pm:144]:9] # spent 3µs making 1 call to Eval::Closure::Sandbox_7::__ANON__[(eval 68)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_140::__ANON__[(eval 203)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_16::__ANON__[(eval 77)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_23::__ANON__[(eval 84)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_5::__ANON__[(eval 66)[Eval/Closure.pm:144]:9] # spent 2µs making 1 call to Eval::Closure::Sandbox_69::__ANON__[(eval 132)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_144::__ANON__[(eval 207)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_65::__ANON__[(eval 126)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_141::__ANON__[(eval 204)[Eval/Closure.pm:144]:6] # spent 2µs making 1 call to Eval::Closure::Sandbox_52::__ANON__[(eval 113)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_56::__ANON__[(eval 117)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_64::__ANON__[(eval 125)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_66::__ANON__[(eval 127)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_46::__ANON__[(eval 107)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_47::__ANON__[(eval 108)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_49::__ANON__[(eval 110)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_51::__ANON__[(eval 112)[Eval/Closure.pm:144]:4] # spent 2µs making 1 call to Eval::Closure::Sandbox_48::__ANON__[(eval 109)[Eval/Closure.pm:144]:4]
118 }
119
120241196µs if (defined($code) && (!ref($code) || ref($code) ne 'CODE')) {
121 $e = "The 'source' parameter must return a subroutine reference, "
122 . "not $code";
123 undef $code;
124 }
125
12624131µs if ($alias) {
127 require Devel::LexAlias;
128 Devel::LexAlias::lexalias($code, $_, $captures->{$_})
129 for grep !/^\&/, keys %$captures;
130 }
131
132241577µs return ($code, $e);
133}
134
135
# spent 39.3ms (1.61+37.7) within Eval::Closure::_make_compiler which was called 241 times, avg 163µs/call: # 241 times (1.61ms+37.7ms) by Eval::Closure::_clean_eval_closure at line 114, avg 163µs/call
sub _make_compiler {
136241296µs2412.23ms my $source = _make_compiler_source(@_);
# spent 2.23ms making 241 calls to Eval::Closure::_make_compiler_source, avg 9µs/call
137
138482838µs24135.4ms return @{ _clean_eval($source) };
# spent 35.4ms making 241 calls to Eval::Closure::_clean_eval, avg 147µs/call
139}
140
141
# spent 35.4ms within Eval::Closure::_clean_eval which was called 241 times, avg 147µs/call: # 241 times (35.4ms+0s) by Eval::Closure::_make_compiler at line 138, avg 147µs/call
sub _clean_eval {
14224170µs local $@;
143241528µs local $SIG{__DIE__};
14424133.1ms my $compiler = eval $_[0];
# spent 18.7ms executing statements in 241 string evals (merged)
# includes 1.15ms spent executing 273 calls to 489 subs defined therein.
14524160µs my $e = $@;
1462411.21ms [ $compiler, $e ];
147}
148
1491200ns$Eval::Closure::SANDBOX_ID = 0;
150
151
# spent 2.23ms (1.56+670µs) within Eval::Closure::_make_compiler_source which was called 241 times, avg 9µs/call: # 241 times (1.56ms+670µs) by Eval::Closure::_make_compiler at line 136, avg 9µs/call
sub _make_compiler_source {
152241187µs my ($source, $alias, @capture_keys) = @_;
15324155µs $Eval::Closure::SANDBOX_ID++;
15424138µs my $i = 0;
155216233µs216670µs return join "\n", (
# spent 670µs making 216 calls to Eval::Closure::_make_lexical_assignment, avg 3µs/call
156 "package Eval::Closure::Sandbox_$Eval::Closure::SANDBOX_ID;",
157 'sub {',
1582411.04ms (map { _make_lexical_assignment($_, $i++, $alias) } @capture_keys),
159 $source,
160 '}',
161 );
162}
163
164
# spent 670µs within Eval::Closure::_make_lexical_assignment which was called 216 times, avg 3µs/call: # 216 times (670µs+0s) by Eval::Closure::_make_compiler_source at line 155, avg 3µs/call
sub _make_lexical_assignment {
16521696µs my ($key, $index, $alias) = @_;
166216106µs my $sigil = substr($key, 0, 1);
16721653µs my $name = substr($key, 1);
168 if (HAS_LEXICAL_SUBS && $sigil eq '&') {
169 my $tmpname = '$__' . $name . '__' . $index;
170 return 'use feature "lexical_subs"; '
171 . 'no warnings "experimental::lexical_subs"; '
172 . 'my ' . $tmpname . ' = $_[' . $index . ']; '
173 . 'my sub ' . $name . ' { goto ' . $tmpname . ' }';
174 }
17521629µs if ($alias) {
176 return 'my ' . $key . ';';
177 }
178 else {
179216597µs return 'my ' . $key . ' = ' . $sigil . '{$_[' . $index . ']};';
180 }
181}
182
183sub _dump_source {
184 my ($source) = @_;
185
186 my $output;
187 if (try { require Perl::Tidy }) {
188 Perl::Tidy::perltidy(
189 source => \$source,
190 destination => \$output,
191 argv => [],
192 );
193 }
194 else {
195 $output = $source;
196 }
197
198 warn "$output\n";
199}
200
201
20214µs1;
203
204__END__
 
# spent 237µs within Eval::Closure::CORE:match which was called 216 times, avg 1µs/call: # 216 times (237µs+0s) by Eval::Closure::_validate_env at line 89, avg 1µs/call
sub Eval::Closure::CORE:match; # opcode
# spent 312µs within Eval::Closure::CORE:sort which was called 241 times, avg 1µs/call: # 241 times (312µs+0s) by Eval::Closure::_clean_eval_closure at line 108, avg 1µs/call
sub Eval::Closure::CORE:sort; # opcode