| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Eval/Closure.pm |
| Statements | Executed 10665 statements in 300ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 276 | 1 | 1 | 187ms | 198ms | Eval::Closure::_make_compiler |
| 296 | 1 | 1 | 30.0ms | 351ms | Eval::Closure::eval_closure |
| 296 | 1 | 1 | 28.4ms | 275ms | Eval::Closure::_clean_eval_closure |
| 296 | 1 | 1 | 19.8ms | 27.1ms | Eval::Closure::_validate_env |
| 296 | 1 | 1 | 12.8ms | 14.7ms | Eval::Closure::_canonicalize_source |
| 276 | 1 | 1 | 10.4ms | 10.4ms | Eval::Closure::_make_compiler_source |
| 1 | 1 | 1 | 8.78ms | 12.6ms | Eval::Closure::BEGIN@7 |
| 1 | 1 | 1 | 7.04ms | 8.66ms | Eval::Closure::BEGIN@15 |
| 296 | 1 | 1 | 4.50ms | 4.50ms | Eval::Closure::_line_directive |
| 1 | 1 | 1 | 56µs | 56µs | Eval::Closure::BEGIN@2 |
| 1 | 1 | 1 | 42µs | 245µs | Eval::Closure::BEGIN@13 |
| 1 | 1 | 1 | 40µs | 209µs | Eval::Closure::BEGIN@17 |
| 1 | 1 | 1 | 40µs | 177µs | Eval::Closure::BEGIN@16 |
| 1 | 1 | 1 | 39µs | 105µs | Eval::Closure::BEGIN@6 |
| 1 | 1 | 1 | 37µs | 54µs | Eval::Closure::BEGIN@5 |
| 1 | 1 | 1 | 20µs | 20µs | Eval::Closure::BEGIN@14 |
| 0 | 0 | 0 | 0s | 0s | Eval::Closure::__ANON__[:133] |
| 0 | 0 | 0 | 0s | 0s | Eval::Closure::_dump_source |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Eval::Closure; | ||||
| 2 | # spent 56µs within Eval::Closure::BEGIN@2 which was called:
# once (56µs+0s) by Class::MOP::Method::Generated::BEGIN@8 at line 4 | ||||
| 3 | 1 | 27µs | $Eval::Closure::VERSION = '0.01'; | ||
| 4 | 1 | 71µs | 1 | 56µs | } # spent 56µs making 1 call to Eval::Closure::BEGIN@2 |
| 5 | 3 | 88µs | 2 | 70µs | # spent 54µs (37+17) within Eval::Closure::BEGIN@5 which was called:
# once (37µs+17µs) by Class::MOP::Method::Generated::BEGIN@8 at line 5 # spent 54µs making 1 call to Eval::Closure::BEGIN@5
# spent 17µs making 1 call to strict::import |
| 6 | 3 | 157µs | 2 | 172µs | # spent 105µs (39+66) within Eval::Closure::BEGIN@6 which was called:
# once (39µs+66µs) by Class::MOP::Method::Generated::BEGIN@8 at line 6 # spent 105µs making 1 call to Eval::Closure::BEGIN@6
# spent 66µs making 1 call to warnings::import |
| 7 | 1 | 1.77ms | # spent 12.6ms (8.78+3.86) within Eval::Closure::BEGIN@7 which was called:
# once (8.78ms+3.86ms) by Class::MOP::Method::Generated::BEGIN@8 at line 10 # spent 1.77ms making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756] | ||
| 8 | exports => [qw(eval_closure)], | ||||
| 9 | groups => { default => [qw(eval_closure)] }, | ||||
| 10 | 3 | 665µs | 1 | 12.6ms | }; # spent 12.6ms making 1 call to Eval::Closure::BEGIN@7 |
| 11 | # ABSTRACT: safely and cleanly create closures via string eval | ||||
| 12 | |||||
| 13 | 3 | 100µs | 2 | 447µs | # spent 245µs (42+203) within Eval::Closure::BEGIN@13 which was called:
# once (42µs+203µs) by Class::MOP::Method::Generated::BEGIN@8 at line 13 # spent 245µs making 1 call to Eval::Closure::BEGIN@13
# spent 203µs making 1 call to Exporter::import |
| 14 | 3 | 79µs | 1 | 20µs | # spent 20µs within Eval::Closure::BEGIN@14 which was called:
# once (20µs+0s) by Class::MOP::Method::Generated::BEGIN@8 at line 14 # spent 20µs making 1 call to Eval::Closure::BEGIN@14 |
| 15 | 3 | 725µs | 2 | 8.83ms | # spent 8.66ms (7.04+1.62) within Eval::Closure::BEGIN@15 which was called:
# once (7.04ms+1.62ms) by Class::MOP::Method::Generated::BEGIN@8 at line 15 # spent 8.66ms making 1 call to Eval::Closure::BEGIN@15
# spent 168µs making 1 call to Exporter::import |
| 16 | 3 | 101µs | 2 | 315µs | # spent 177µs (40+137) within Eval::Closure::BEGIN@16 which was called:
# once (40µs+137µs) by Class::MOP::Method::Generated::BEGIN@8 at line 16 # spent 177µs making 1 call to Eval::Closure::BEGIN@16
# spent 137µs making 1 call to Exporter::import |
| 17 | 3 | 2.35ms | 2 | 377µs | # spent 209µs (40+168) within Eval::Closure::BEGIN@17 which was called:
# once (40µs+168µs) by Class::MOP::Method::Generated::BEGIN@8 at line 17 # spent 209µs making 1 call to Eval::Closure::BEGIN@17
# spent 168µs making 1 call to Exporter::import |
| 18 | |||||
| - - | |||||
| 21 | # spent 351ms (30.0+321) within Eval::Closure::eval_closure which was called 296 times, avg 1.19ms/call:
# 296 times (30.0ms+321ms) by Class::MOP::Method::Generated::_compile_code at line 51 of Class/MOP/Method/Generated.pm, avg 1.19ms/call | ||||
| 22 | 2072 | 27.5ms | my (%args) = @_; | ||
| 23 | |||||
| 24 | 296 | 14.7ms | $args{source} = _canonicalize_source($args{source}); # spent 14.7ms making 296 calls to Eval::Closure::_canonicalize_source, avg 50µs/call | ||
| 25 | 296 | 27.1ms | _validate_env($args{environment} ||= {}); # spent 27.1ms making 296 calls to Eval::Closure::_validate_env, avg 92µs/call | ||
| 26 | |||||
| 27 | 296 | 4.50ms | $args{source} = _line_directive($args{description}) . $args{source} # spent 4.50ms making 296 calls to Eval::Closure::_line_directive, avg 15µs/call | ||
| 28 | if defined $args{description}; | ||||
| 29 | |||||
| 30 | 296 | 275ms | my ($code, $e) = _clean_eval_closure(@args{qw(source environment)}); # spent 275ms making 296 calls to Eval::Closure::_clean_eval_closure, avg 929µs/call | ||
| 31 | |||||
| 32 | croak("Failed to compile source: $e\n\nsource:\n$args{source}") | ||||
| 33 | unless $code; | ||||
| 34 | |||||
| 35 | return $code; | ||||
| 36 | } | ||||
| 37 | |||||
| 38 | # spent 14.7ms (12.8+1.89) within Eval::Closure::_canonicalize_source which was called 296 times, avg 50µs/call:
# 296 times (12.8ms+1.89ms) by Eval::Closure::eval_closure at line 24, avg 50µs/call | ||||
| 39 | 592 | 1.66ms | my ($source) = @_; | ||
| 40 | |||||
| 41 | 296 | 929µs | if (defined($source)) { | ||
| 42 | 296 | 12.8ms | if (ref($source)) { | ||
| 43 | 296 | 1.89ms | if (reftype($source) eq 'ARRAY' # spent 1.89ms making 296 calls to Scalar::Util::reftype, avg 6µs/call | ||
| 44 | || overload::Method($source, '@{}')) { | ||||
| 45 | return join "\n", @$source; | ||||
| 46 | } | ||||
| 47 | elsif (overload::Method($source, '""')) { | ||||
| 48 | return "$source"; | ||||
| 49 | } | ||||
| 50 | else { | ||||
| 51 | croak("The 'source' parameter to eval_closure must be a " | ||||
| 52 | . "string or array reference"); | ||||
| 53 | } | ||||
| 54 | } | ||||
| 55 | else { | ||||
| 56 | return $source; | ||||
| 57 | } | ||||
| 58 | } | ||||
| 59 | else { | ||||
| 60 | croak("The 'source' parameter to eval_closure is required"); | ||||
| 61 | } | ||||
| 62 | } | ||||
| 63 | |||||
| 64 | # spent 27.1ms (19.8+7.33) within Eval::Closure::_validate_env which was called 296 times, avg 92µs/call:
# 296 times (19.8ms+7.33ms) by Eval::Closure::eval_closure at line 25, avg 92µs/call | ||||
| 65 | 888 | 11.6ms | my ($env) = @_; | ||
| 66 | |||||
| 67 | 296 | 1.49ms | croak("The 'environment' parameter must be a hashref") # spent 1.49ms making 296 calls to Scalar::Util::reftype, avg 5µs/call | ||
| 68 | unless reftype($env) eq 'HASH'; | ||||
| 69 | |||||
| 70 | for my $var (keys %$env) { | ||||
| 71 | 1326 | 16.1ms | 663 | 5.84ms | croak("Environment key '$var' should start with \@, \%, or \$") # spent 5.84ms making 663 calls to Eval::Closure::CORE:match, avg 9µs/call |
| 72 | unless $var =~ /^([\@\%\$])/; | ||||
| 73 | croak("Environment values must be references, not $env->{$var}") | ||||
| 74 | unless ref($env->{$var}); | ||||
| 75 | } | ||||
| 76 | } | ||||
| 77 | |||||
| 78 | # spent 4.50ms within Eval::Closure::_line_directive which was called 296 times, avg 15µs/call:
# 296 times (4.50ms+0s) by Eval::Closure::eval_closure at line 27, avg 15µs/call | ||||
| 79 | 592 | 5.20ms | my ($description) = @_; | ||
| 80 | |||||
| 81 | return qq{#line 1 "$description"\n}; | ||||
| 82 | } | ||||
| 83 | |||||
| 84 | # spent 275ms (28.4+247) within Eval::Closure::_clean_eval_closure which was called 296 times, avg 929µs/call:
# 296 times (28.4ms+247ms) by Eval::Closure::eval_closure at line 30, avg 929µs/call | ||||
| 85 | 2368 | 25.2ms | my ($source, $captures) = @_; | ||
| 86 | |||||
| 87 | if ($ENV{EVAL_CLOSURE_PRINT_SOURCE}) { | ||||
| 88 | _dump_source(_make_compiler_source(@_)); | ||||
| 89 | } | ||||
| 90 | |||||
| 91 | 296 | 1.66ms | my @capture_keys = sort keys %$captures; # spent 1.66ms making 296 calls to Eval::Closure::CORE:sort, avg 6µs/call | ||
| 92 | 296 | 6.34ms | my ($compiler, $e) = _make_compiler($source, @capture_keys); # spent 6.34ms making 296 calls to Memoize::__ANON__[(eval 30)[Memoize.pm:73]:1], avg 21µs/call | ||
| 93 | my $code; | ||||
| 94 | 296 | 7.53ms | if (defined $compiler) { # spent 1.06ms making 71 calls to Eval::Closure::__ANON__[generated method (unknown origin):7], avg 15µs/call
# spent 622µs making 39 calls to Eval::Closure::__ANON__[generated method (unknown origin):6], avg 16µs/call
# spent 616µs making 15 calls to Eval::Closure::__ANON__[generated method (unknown origin):45], avg 41µs/call
# spent 480µs making 14 calls to Eval::Closure::__ANON__[generated method (unknown origin):35], avg 34µs/call
# spent 252µs making 5 calls to Eval::Closure::__ANON__[accessor _native_type (defined at Moose/Meta/Attribute/Native/Trait.pm line 191):23], avg 50µs/call
# spent 235µs making 16 calls to Eval::Closure::__ANON__[generated method (unknown origin):4], avg 15µs/call
# spent 189µs making 7 calls to Eval::Closure::__ANON__[generated method (unknown origin):40], avg 27µs/call
# spent 154µs making 5 calls to Eval::Closure::__ANON__[accessor _used_default_is (defined at Moose/Meta/Attribute/Native/Trait.pm line 15):10], avg 31µs/call
# spent 144µs making 3 calls to Eval::Closure::__ANON__[generated method (unknown origin):59], avg 48µs/call
# spent 118µs making 4 calls to Eval::Closure::__ANON__[generated method (unknown origin):25], avg 29µs/call
# spent 99µs making 1 call to Eval::Closure::__ANON__[accessor delimiter (defined at Markdent/Event/StartEmphasis.pm line 15):7]
# spent 98µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):228]
# spent 92µs making 3 calls to Eval::Closure::__ANON__[accessor debug (defined at Markdent/Role/DebugPrinter.pm line 14):10], avg 31µs/call
# spent 90µs making 3 calls to Eval::Closure::__ANON__[accessor handler (defined at Markdent/Role/AnyParser.pm line 14):7], avg 30µs/call
# spent 70µs making 2 calls to Eval::Closure::__ANON__[Markdent/Dialect/Standard/BlockParser.pm (line 50):10], avg 35µs/call
# spent 68µs making 3 calls to Eval::Closure::__ANON__[generated method (unknown origin):28], avg 23µs/call
# spent 65µs making 3 calls to Eval::Closure::__ANON__[generated method (unknown origin):22], avg 22µs/call
# spent 63µs making 2 calls to Eval::Closure::__ANON__[Markdent/Dialect/Standard/BlockParser.pm (line 62):10], avg 31µs/call
# spent 63µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):210]
# spent 56µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):106]
# spent 55µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):150]
# spent 52µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):105]
# spent 51µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):93]
# spent 50µs making 2 calls to Eval::Closure::__ANON__[generated method (unknown origin):24], avg 25µs/call
# spent 48µs making 2 calls to Eval::Closure::__ANON__[generated method (unknown origin):43], avg 24µs/call
# spent 47µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):73]
# spent 47µs making 2 calls to Eval::Closure::__ANON__[generated method (unknown origin):37], avg 23µs/call
# spent 45µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):83]
# spent 45µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):58]
# spent 43µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 69):25]
# spent 42µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/BlockParser.pm (line 43):25]
# spent 37µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 43):12]
# spent 37µs making 1 call to Eval::Closure::__ANON__[accessor level (defined at Markdent/Event/StartHeader.pm line 15):7]
# spent 37µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 43):9]
# spent 36µs making 1 call to Eval::Closure::__ANON__[accessor text (defined at Markdent/Event/Text.pm line 15):7]
# spent 34µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 69):13]
# spent 33µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):30]
# spent 33µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 51):13]
# spent 32µs making 1 call to Eval::Closure::__ANON__[accessor id (defined at Markdent/Event/Image.pm line 33):7]
# spent 32µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 43):8]
# spent 32µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 51):8]
# spent 32µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/BlockParser.pm (line 43):13]
# spent 32µs making 1 call to Eval::Closure::__ANON__[accessor _set__pending_events of attribute __pending_events (defined at Markdent/Dialect/Standard/SpanParser.pm line 43):7]
# spent 32µs making 1 call to Eval::Closure::__ANON__[Markdent/Dialect/Standard/SpanParser.pm (line 51):10]
# spent 32µs making 1 call to Eval::Closure::__ANON__[accessor _output (defined at Markdent/Role/HTMLStream.pm line 24):7]
# spent 31µs making 1 call to Eval::Closure::__ANON__[accessor _span_parser (defined at Markdent/Parser.pm line 57):23]
# spent 31µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):139]
# spent 31µs making 1 call to Eval::Closure::__ANON__[accessor _stream (defined at Markdent/Role/HTMLStream.pm line 37):14]
# spent 30µs making 1 call to Eval::Closure::__ANON__[accessor _span_parser (defined at Markdent/Role/BlockParser.pm line 16):7]
# spent 30µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):130]
# spent 30µs making 1 call to Eval::Closure::__ANON__[accessor text (defined at Markdent/Event/HTMLCommentBlock.pm line 15):7]
# spent 30µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):94]
# spent 30µs making 1 call to Eval::Closure::__ANON__[accessor _block_parser (defined at Markdent/Parser.pm line 30):23]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor _list_level (defined at Markdent/Dialect/Standard/BlockParser.pm line 50):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor _escape_re (defined at Markdent/Dialect/Standard/SpanParser.pm line 76):23]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor tag (defined at Markdent/Event/StartHTMLTag.pm line 15):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor _escapable_chars (defined at Markdent/Dialect/Standard/SpanParser.pm line 84):23]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor text (defined at Markdent/Event/HTMLComment.pm line 15):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor _set_list_level of attribute _list_level (defined at Markdent/Dialect/Standard/BlockParser.pm line 50):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor delimiter (defined at Markdent/Event/EndCode.pm line 15):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor delimiter (defined at Markdent/Event/EndEmphasis.pm line 15):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor entity (defined at Markdent/Event/HTMLEntity.pm line 15):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):97]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor text (defined at Markdent/Event/Preformatted.pm line 15):7]
# spent 29µs making 1 call to Eval::Closure::__ANON__[accessor uri (defined at Markdent/Event/StartLink.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor html (defined at Markdent/Event/HTMLBlock.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor parameters (defined at MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm line 14):10]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor delimiter (defined at Markdent/Event/StartCode.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor uri (defined at Markdent/Event/AutoLink.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _converted_from (defined at Markdent/Event/Text.pm line 21):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor parameters_metaclass (defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 32):17]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor tag (defined at Markdent/Event/HTMLTag.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):103]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor attributes (defined at Markdent/Event/StartHTMLTag.pm line 25):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _set_block_parser_class of attribute _block_parser_class (defined at Markdent/Parser.pm line 23):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _set_span_parser_args of attribute _span_parser_args (defined at Markdent/Parser.pm line 51):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _span_text_buffer (defined at Markdent/Dialect/Standard/SpanParser.pm line 51):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor uri (defined at Markdent/Event/Image.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor delimiter (defined at Markdent/Event/StartStrong.pm line 15):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor title (defined at Markdent/Event/Image.pm line 27):7]
# spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _block_parser_class (defined at Markdent/Parser.pm line 23):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _span_parser_args (defined at Markdent/Parser.pm line 51):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor alt_text (defined at Markdent/Event/Image.pm line 21):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor genitor (defined at MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm line 8):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor is_implicit_id (defined at Markdent/Event/Image.pm line 39):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor tag (defined at Markdent/Event/EndHTMLTag.pm line 15):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _span_parser_class (defined at Markdent/Parser.pm line 44):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor delimiter (defined at Markdent/Event/EndStrong.pm line 15):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _block_parser_args (defined at Markdent/Parser.pm line 38):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _set_block_parser_args of attribute _block_parser_args (defined at Markdent/Parser.pm line 38):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor attributes (defined at Markdent/Event/HTMLTag.pm line 25):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor title (defined at Markdent/Handler/HTMLStream/Document.pm line 17):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor __pending_events (defined at Markdent/Dialect/Standard/SpanParser.pm line 43):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor parameters_class (defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 14):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _set_span_parser_class of attribute _span_parser_class (defined at Markdent/Parser.pm line 44):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _merged_from (defined at Markdent/Event/Text.pm line 27):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _links_by_id (defined at Markdent/Dialect/Standard/SpanParser.pm line 69):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor title (defined at Markdent/Event/StartLink.pm line 21):7]
# spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _list_item_is_paragraph (defined at Markdent/Dialect/Standard/BlockParser.pm line 62):7]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor __html_blocks (defined at Markdent/Dialect/Standard/BlockParser.pm line 43):7]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor level (defined at Markdent/Event/EndHeader.pm line 15):7]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _has_merged_from of attribute _merged_from (defined at Markdent/Event/Text.pm line 27):4]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor id (defined at Markdent/Event/StartLink.pm line 27):7]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor role_generator (defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 37):10]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor has_role_generator of attribute role_generator (defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 37):4]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor has_title of attribute title (defined at Markdent/Event/StartLink.pm line 21):4]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor is_implicit_id (defined at Markdent/Event/StartLink.pm line 33):7]
# spent 26µs making 1 call to Eval::Closure::__ANON__[accessor has_title of attribute title (defined at Markdent/Event/Image.pm line 27):4]
# spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_id of attribute id (defined at Markdent/Event/StartLink.pm line 27):4]
# spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_id of attribute id (defined at Markdent/Event/Image.pm line 33):4]
# spent 25µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):16]
# spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _has_converted_from of attribute _converted_from (defined at Markdent/Event/Text.pm line 21):4]
# spent 21µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):13]
# spent 20µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):19] | ||
| 95 | $code = $compiler->(@$captures{@capture_keys}); | ||||
| 96 | } | ||||
| 97 | |||||
| 98 | if (defined($code) && (!ref($code) || ref($code) ne 'CODE')) { | ||||
| 99 | $e = "The 'source' parameter must return a subroutine reference, " | ||||
| 100 | . "not $code"; | ||||
| 101 | undef $code; | ||||
| 102 | } | ||||
| 103 | |||||
| 104 | return ($code, $e); | ||||
| 105 | } | ||||
| 106 | |||||
| 107 | # spent 198ms (187+10.4) within Eval::Closure::_make_compiler which was called 276 times, avg 716µs/call:
# 276 times (187ms+10.4ms) by Memoize::_memoizer at line 269 of Memoize.pm, avg 716µs/call | ||||
| 108 | 1380 | 183ms | local $@; | ||
| 109 | local $SIG{__DIE__}; | ||||
| 110 | 276 | 10.4ms | my $compiler = eval _make_compiler_source(@_); # spent 10.4ms making 276 calls to Eval::Closure::_make_compiler_source, avg 38µs/call # spent 61µs executing statements in string eval
# spent 58µs executing statements in string eval
# spent 55µs executing statements in string eval
# spent 33µs executing statements in string eval
# spent 33µs executing statements in string eval
# spent 26µs executing statements in string eval
# spent 25µs executing statements in string eval
# spent 23µs executing statements in string eval
# spent 23µs executing statements in string eval
# spent 23µs executing statements in string eval
# spent 22µs executing statements in string eval
# spent 22µs executing statements in string eval
# spent 20µs executing statements in string eval
# spent 19µs executing statements in string eval
# spent 19µs executing statements in string eval
# spent 19µs executing statements in string eval
# spent 18µs executing statements in string eval
# spent 18µs executing statements in string eval
# spent 18µs executing statements in string eval
# spent 18µs executing statements in string eval
# spent 18µs executing statements in string eval
# spent 18µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 16µs executing statements in string eval
# spent 15µs executing statements in string eval
# spent 15µs executing statements in string eval
# spent 15µs executing statements in string eval
# spent 15µs executing statements in string eval
# spent 15µs executing statements in string eval
# spent 15µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 14µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 13µs executing statements in string eval
# spent 12µs executing statements in string eval
# spent 12µs executing statements in string eval
# spent 12µs executing statements in string eval
# spent 12µs executing statements in string eval
# spent 12µs executing statements in string eval
# spent 12µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 11µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 9µs executing statements in string eval
# spent 9µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval
# spent 3µs executing statements in string eval | ||
| 111 | my $e = $@; | ||||
| 112 | return ($compiler, $e); | ||||
| 113 | } | ||||
| 114 | 1 | 15µs | 1 | 880µs | memoize('_make_compiler'); # spent 880µs making 1 call to Memoize::memoize |
| 115 | |||||
| 116 | # spent 10.4ms within Eval::Closure::_make_compiler_source which was called 276 times, avg 38µs/call:
# 276 times (10.4ms+0s) by Eval::Closure::_make_compiler at line 110, avg 38µs/call | ||||
| 117 | 828 | 11.6ms | my ($source, @capture_keys) = @_; | ||
| 118 | my $i = 0; | ||||
| 119 | return join "\n", ( | ||||
| 120 | 'sub {', | ||||
| 121 | (map { | ||||
| 122 | 'my ' . $_ . ' = ' . substr($_, 0, 1) . '{$_[' . $i++ . ']};' | ||||
| 123 | } @capture_keys), | ||||
| 124 | $source, | ||||
| 125 | '}', | ||||
| 126 | ); | ||||
| 127 | } | ||||
| 128 | |||||
| 129 | sub _dump_source { | ||||
| 130 | my ($source) = @_; | ||||
| 131 | |||||
| 132 | my $output; | ||||
| 133 | if (try { require Perl::Tidy }) { | ||||
| 134 | Perl::Tidy::perltidy( | ||||
| 135 | source => \$source, | ||||
| 136 | destination => \$output, | ||||
| 137 | ); | ||||
| 138 | } | ||||
| 139 | else { | ||||
| 140 | $output = $source; | ||||
| 141 | } | ||||
| 142 | |||||
| 143 | warn "$output\n"; | ||||
| 144 | } | ||||
| 145 | |||||
| 146 | |||||
| 147 | 1 | 12µs | 1; | ||
| 148 | |||||
| 149 | __END__ |