← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:04:45 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Eval/Closure.pm
StatementsExecuted 13387 statements in 365ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
35011227ms241msEval::Closure::::_make_compilerEval::Closure::_make_compiler
3611136.7ms338msEval::Closure::::_clean_eval_closureEval::Closure::_clean_eval_closure
3611135.5ms432msEval::Closure::::eval_closureEval::Closure::eval_closure
3611126.0ms34.1msEval::Closure::::_validate_envEval::Closure::_validate_env
3611115.6ms18.2msEval::Closure::::_canonicalize_sourceEval::Closure::_canonicalize_source
3501114.0ms14.0msEval::Closure::::_make_compiler_sourceEval::Closure::_make_compiler_source
1119.15ms12.9msEval::Closure::::BEGIN@7Eval::Closure::BEGIN@7
1117.71ms9.00msEval::Closure::::BEGIN@15Eval::Closure::BEGIN@15
361115.66ms5.66msEval::Closure::::_line_directiveEval::Closure::_line_directive
11146µs68µsEval::Closure::::BEGIN@5Eval::Closure::BEGIN@5
11143µs249µsEval::Closure::::BEGIN@13Eval::Closure::BEGIN@13
11143µs43µsEval::Closure::::BEGIN@2Eval::Closure::BEGIN@2
11141µs173µsEval::Closure::::BEGIN@16Eval::Closure::BEGIN@16
11139µs105µsEval::Closure::::BEGIN@6Eval::Closure::BEGIN@6
11138µs219µsEval::Closure::::BEGIN@17Eval::Closure::BEGIN@17
11121µs21µsEval::Closure::::BEGIN@14Eval::Closure::BEGIN@14
0000s0sEval::Closure::::__ANON__[:133]Eval::Closure::__ANON__[:133]
0000s0sEval::Closure::::_dump_sourceEval::Closure::_dump_source
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 43µs within Eval::Closure::BEGIN@2 which was called: # once (43µs+0s) by Class::MOP::Method::Generated::BEGIN@8 at line 4
BEGIN {
3134µs $Eval::Closure::VERSION = '0.01';
4172µs143µs}
# spent 43µs making 1 call to Eval::Closure::BEGIN@2
5398µs291µs
# spent 68µs (46+22) within Eval::Closure::BEGIN@5 which was called: # once (46µs+22µs) by Class::MOP::Method::Generated::BEGIN@8 at line 5
use strict;
# spent 68µs making 1 call to Eval::Closure::BEGIN@5 # spent 22µs making 1 call to strict::import
63152µs2172µ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
use warnings;
# spent 105µs making 1 call to Eval::Closure::BEGIN@6 # spent 66µs making 1 call to warnings::import
711.78ms
# spent 12.9ms (9.15+3.72) within Eval::Closure::BEGIN@7 which was called: # once (9.15ms+3.72ms) by Class::MOP::Method::Generated::BEGIN@8 at line 10
use Sub::Exporter -setup => {
# spent 1.78ms making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
8 exports => [qw(eval_closure)],
9 groups => { default => [qw(eval_closure)] },
103600µs112.9ms};
# spent 12.9ms making 1 call to Eval::Closure::BEGIN@7
11# ABSTRACT: safely and cleanly create closures via string eval
12
13399µs2454µs
# spent 249µs (43+205) within Eval::Closure::BEGIN@13 which was called: # once (43µs+205µs) by Class::MOP::Method::Generated::BEGIN@8 at line 13
use Carp;
# spent 249µs making 1 call to Eval::Closure::BEGIN@13 # spent 205µs making 1 call to Exporter::import
14378µs121µs
# spent 21µs within Eval::Closure::BEGIN@14 which was called: # once (21µs+0s) by Class::MOP::Method::Generated::BEGIN@8 at line 14
use overload ();
# spent 21µs making 1 call to Eval::Closure::BEGIN@14
153743µs29.24ms
# spent 9.00ms (7.71+1.29) within Eval::Closure::BEGIN@15 which was called: # once (7.71ms+1.29ms) by Class::MOP::Method::Generated::BEGIN@8 at line 15
use Memoize;
# spent 9.00ms making 1 call to Eval::Closure::BEGIN@15 # spent 240µs making 1 call to Exporter::import
16396µs2306µs
# spent 173µs (41+133) within Eval::Closure::BEGIN@16 which was called: # once (41µs+133µs) by Class::MOP::Method::Generated::BEGIN@8 at line 16
use Scalar::Util qw(reftype);
# spent 173µs making 1 call to Eval::Closure::BEGIN@16 # spent 132µs making 1 call to Exporter::import
1732.24ms2400µs
# spent 219µs (38+181) within Eval::Closure::BEGIN@17 which was called: # once (38µs+181µs) by Class::MOP::Method::Generated::BEGIN@8 at line 17
use Try::Tiny;
# spent 219µs making 1 call to Eval::Closure::BEGIN@17 # spent 181µs making 1 call to Exporter::import
18
- -
21
# spent 432ms (35.5+396) within Eval::Closure::eval_closure which was called 361 times, avg 1.20ms/call: # 361 times (35.5ms+396ms) by Class::MOP::Method::Generated::_compile_code at line 51 of Class/MOP/Method/Generated.pm, avg 1.20ms/call
sub eval_closure {
22252732.8ms my (%args) = @_;
23
2436118.2ms $args{source} = _canonicalize_source($args{source});
# spent 18.2ms making 361 calls to Eval::Closure::_canonicalize_source, avg 50µs/call
2536134.1ms _validate_env($args{environment} ||= {});
# spent 34.1ms making 361 calls to Eval::Closure::_validate_env, avg 94µs/call
26
273615.66ms $args{source} = _line_directive($args{description}) . $args{source}
# spent 5.66ms making 361 calls to Eval::Closure::_line_directive, avg 16µs/call
28 if defined $args{description};
29
30361338ms my ($code, $e) = _clean_eval_closure(@args{qw(source environment)});
# spent 338ms making 361 calls to Eval::Closure::_clean_eval_closure, avg 938µ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 18.2ms (15.6+2.65) within Eval::Closure::_canonicalize_source which was called 361 times, avg 50µs/call: # 361 times (15.6ms+2.65ms) by Eval::Closure::eval_closure at line 24, avg 50µs/call
sub _canonicalize_source {
39144418.6ms my ($source) = @_;
40
41 if (defined($source)) {
42 if (ref($source)) {
433612.65ms if (reftype($source) eq 'ARRAY'
# spent 2.65ms making 361 calls to Scalar::Util::reftype, avg 7µ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 34.1ms (26.0+8.10) within Eval::Closure::_validate_env which was called 361 times, avg 94µs/call: # 361 times (26.0ms+8.10ms) by Eval::Closure::eval_closure at line 25, avg 94µs/call
sub _validate_env {
65297935.0ms my ($env) = @_;
66
673611.66ms croak("The 'environment' parameter must be a hashref")
# spent 1.66ms making 361 calls to Scalar::Util::reftype, avg 5µs/call
68 unless reftype($env) eq 'HASH';
69
70 for my $var (keys %$env) {
719486.44ms croak("Environment key '$var' should start with \@, \%, or \$")
# spent 6.44ms making 948 calls to Eval::Closure::CORE:match, avg 7µ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 5.66ms within Eval::Closure::_line_directive which was called 361 times, avg 16µs/call: # 361 times (5.66ms+0s) by Eval::Closure::eval_closure at line 27, avg 16µs/call
sub _line_directive {
797226.72ms my ($description) = @_;
80
81 return qq{#line 1 "$description"\n};
82}
83
84
# spent 338ms (36.7+302) within Eval::Closure::_clean_eval_closure which was called 361 times, avg 938µs/call: # 361 times (36.7ms+302ms) by Eval::Closure::eval_closure at line 30, avg 938µs/call
sub _clean_eval_closure {
85288831.0ms my ($source, $captures) = @_;
86
87 if ($ENV{EVAL_CLOSURE_PRINT_SOURCE}) {
88 _dump_source(_make_compiler_source(@_));
89 }
90
913612.21ms my @capture_keys = sort keys %$captures;
# spent 2.21ms making 361 calls to Eval::Closure::CORE:sort, avg 6µs/call
923617.69ms my ($compiler, $e) = _make_compiler($source, @capture_keys);
# spent 7.69ms making 361 calls to Memoize::__ANON__[(eval 30)[Memoize.pm:73]:1], avg 21µs/call
93 my $code;
943619.06ms if (defined $compiler) {
# spent 1.03ms making 70 calls to Eval::Closure::__ANON__[generated method (unknown origin):7], avg 15µs/call # spent 352µs making 22 calls to Eval::Closure::__ANON__[generated method (unknown origin):6], avg 16µs/call # spent 285µs making 10 calls to Eval::Closure::__ANON__[generated method (unknown origin):40], avg 28µs/call # spent 221µs making 16 calls to Eval::Closure::__ANON__[generated method (unknown origin):4], avg 14µs/call # spent 109µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):187] # spent 91µs making 4 calls to Eval::Closure::__ANON__[generated method (unknown origin):25], avg 23µs/call # spent 78µs making 2 calls to Eval::Closure::__ANON__[generated method (unknown origin):45], avg 39µs/call # spent 77µs making 2 calls to Eval::Closure::__ANON__[accessor _native_type (defined at Moose/Meta/Attribute/Native/Trait.pm line 191):23], avg 39µs/call # spent 75µs making 2 calls to Eval::Closure::__ANON__[generated method (unknown origin):43], avg 38µs/call # spent 70µs making 3 calls to Eval::Closure::__ANON__[generated method (unknown origin):28], avg 23µs/call # spent 68µs making 3 calls to Eval::Closure::__ANON__[generated method (unknown origin):22], avg 23µs/call # spent 66µs making 2 calls to Eval::Closure::__ANON__[accessor _used_default_is (defined at Moose/Meta/Attribute/Native/Trait.pm line 15):10], avg 33µs/call # spent 65µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):47] # spent 61µs making 2 calls to Eval::Closure::__ANON__[KiokuDB/Collapser/Buffer.pm (line 61):8], avg 30µs/call # spent 59µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):152] # spent 57µs making 2 calls to Eval::Closure::__ANON__[accessor previous_exception (defined at Throwable.pm line 16):7], avg 29µs/call # spent 55µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):132] # spent 54µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):129] # spent 52µs making 3 calls to Eval::Closure::__ANON__[generated method (unknown origin):16], avg 17µs/call # spent 50µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):109] # spent 50µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):30] # spent 49µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):92] # spent 48µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):93] # spent 48µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):102] # spent 46µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):90] # spent 46µ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):68] # spent 43µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):91] # spent 43µs making 2 calls to Eval::Closure::__ANON__[generated method (unknown origin):24], avg 22µs/call # spent 43µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):58] # spent 43µs making 1 call to Eval::Closure::__ANON__[accessor typemap_resolver (defined at KiokuDB/Linker.pm line 35):7] # spent 42µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):61] # spent 42µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):65] # spent 41µs making 1 call to Eval::Closure::__ANON__[accessor has_includes of attribute includes (defined at KiokuDB/TypeMap.pm line 37):4] # spent 41µs making 1 call to Eval::Closure::__ANON__[accessor tied_as_objects (defined at Data/Visitor.pm line 21):10] # spent 41µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):51] # spent 40µs making 1 call to Eval::Closure::__ANON__[accessor _no_scope (defined at KiokuDB/Stream/Objects.pm line 51):10] # spent 40µs making 1 call to Eval::Closure::__ANON__[accessor has_root of attribute root (defined at KiokuDB/Entry.pm line 20):4] # spent 40µs making 1 call to Eval::Closure::__ANON__[accessor list_delim (defined at Devel/PartialDump.pm line 92):10] # spent 40µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):53] # spent 40µs making 1 call to Eval::Closure::__ANON__[accessor all_isa_entry_classes (defined at KiokuDB/TypeMap.pm line 31):23] # spent 40µs making 1 call to Eval::Closure::__ANON__[accessor has_object of attribute object (defined at KiokuDB/Entry.pm line 100):4] # spent 40µs making 1 call to Eval::Closure::__ANON__[accessor weaken (defined at KiokuDB/Collapser.pm line 55):10] # spent 40µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):50] # spent 39µs making 1 call to Eval::Closure::__ANON__[accessor weaken (defined at Data/Visitor.pm line 27):10] # spent 39µs making 1 call to Eval::Closure::__ANON__[accessor objects (defined at Devel/PartialDump.pm line 86):10] # spent 38µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB/Stream/Objects.pm line 33):23] # spent 38µs making 1 call to Eval::Closure::__ANON__[accessor has_typemap_resolver of attribute typemap_resolver (defined at KiokuDB.pm line 154):4] # spent 38µs making 1 call to Eval::Closure::__ANON__[accessor has_id of attribute id (defined at KiokuDB/Entry.pm line 12):4] # spent 35µs making 1 call to Eval::Closure::__ANON__[accessor has_merged_typemap of attribute merged_typemap (defined at KiokuDB.pm line 77):4] # spent 34µs making 1 call to Eval::Closure::__ANON__[accessor clear_all_isa_entries of attribute all_isa_entries (defined at KiokuDB/TypeMap.pm line 25):4] # spent 33µs making 1 call to Eval::Closure::__ANON__[accessor has_all_isa_entry_classes of attribute all_isa_entry_classes (defined at KiokuDB/TypeMap.pm line 31):4] # spent 32µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):139] # spent 32µs making 1 call to Eval::Closure::__ANON__[KiokuDB/LiveObjects/Scope.pm (line 12):8] # spent 32µs making 1 call to Eval::Closure::__ANON__[accessor _set_current_scope of attribute current_scope (defined at KiokuDB/LiveObjects.pm line 155):9] # spent 32µs making 1 call to Eval::Closure::__ANON__[accessor _ids (defined at KiokuDB/Collapser/Buffer.pm line 38):7] # spent 32µs making 1 call to Eval::Closure::__ANON__[accessor fallback_entry (defined at KiokuDB/TypeMap/Resolver.pm line 28):7] # spent 32µs making 1 call to Eval::Closure::__ANON__[accessor prev (defined at KiokuDB/Entry.pm line 83):10] # spent 31µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):130] # spent 31µs making 1 call to Eval::Closure::__ANON__[accessor _has_referenced_ids of attribute _referenced_ids (defined at KiokuDB/Entry.pm line 172):4] # spent 31µs making 1 call to Eval::Closure::__ANON__[accessor keep_entries (defined at KiokuDB/LiveObjects.pm line 38):7] # spent 31µs making 1 call to Eval::Closure::__ANON__[KiokuDB/LiveObjects/Scope.pm (line 12):7] # spent 31µs making 1 call to Eval::Closure::__ANON__[KiokuDB/LiveObjects/Scope.pm (line 12):9] # spent 31µs making 1 call to Eval::Closure::__ANON__[accessor backend (defined at KiokuDB/Collapser.pm line 36):7] # spent 30µs making 1 call to Eval::Closure::__ANON__[accessor linker (defined at KiokuDB.pm line 221):23] # spent 30µs making 1 call to Eval::Closure::__ANON__[accessor merged_typemap (defined at KiokuDB.pm line 77):23] # 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 typemap (defined at KiokuDB.pm line 62):7] # spent 30µs making 1 call to Eval::Closure::__ANON__[accessor entries (defined at KiokuDB/TypeMap.pm line 16):20] # spent 30µs making 1 call to Eval::Closure::__ANON__[accessor _references (defined at KiokuDB/Entry.pm line 129):23] # spent 30µs making 1 call to Eval::Closure::__ANON__[accessor root (defined at KiokuDB/Entry.pm line 20):26] # spent 30µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):103] # 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 collapser (defined at KiokuDB.pm line 192):23] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor isa_entries (defined at KiokuDB/TypeMap.pm line 16):20] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor includes (defined at KiokuDB/TypeMap.pm line 37):23] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor linker (defined at KiokuDB/Stream/Objects.pm line 21):23] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor _referenced_ids (defined at KiokuDB/Entry.pm line 172):23] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor id (defined at KiokuDB/Reference.pm line 10):13] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor clear_leaks (defined at KiokuDB/LiveObjects.pm line 22):10] # spent 29µs making 1 call to Eval::Closure::__ANON__[accessor compact (defined at KiokuDB/Collapser.pm line 49):10] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor linker (defined at KiokuDB/Thunk.pm line 14):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor typemap_resolver (defined at KiokuDB.pm line 154):23] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor max_length (defined at Devel/PartialDump.pm line 52):10] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor all_entries (defined at KiokuDB/TypeMap.pm line 25):20] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor all_isa_entries (defined at KiokuDB/TypeMap.pm line 25):20] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor value (defined at KiokuDB/Thunk.pm line 24):23] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB.pm line 172):24] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _scope (defined at KiokuDB/Stream/Objects.pm line 45):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor id (defined at KiokuDB/Entry.pm line 12):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor stringify (defined at Devel/PartialDump.pm line 74):10] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor attr (defined at KiokuDB/Thunk.pm line 19):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _class_version of attribute class_version (defined at KiokuDB/Entry.pm line 62):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _class of attribute class (defined at KiokuDB/Entry.pm line 48):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor current_scope (defined at KiokuDB/LiveObjects.pm line 155):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor filter_body of attribute filter (defined at Data/Stream/Bulk/Filter.pm line 16):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor parent (defined at KiokuDB/LiveObjects/TXNScope.pm line 22):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor entries (defined at KiokuDB/LiveObjects/TXNScope.pm line 14):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _compiled (defined at KiokuDB/TypeMap/Resolver.pm line 22):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor _class_meta of attribute class_meta (defined at KiokuDB/Entry.pm line 55):7] # spent 28µs making 1 call to Eval::Closure::__ANON__[accessor collapsed (defined at KiokuDB/Thunk.pm line 8):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _entries of attribute entries (defined at KiokuDB/Collapser/Buffer.pm line 61):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor tied_as_objects (defined at KiokuDB/Collapser.pm line 28):10] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor has_isa_entries of attribute isa_entries (defined at KiokuDB/TypeMap.pm line 16):4] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor linker_queue (defined at KiokuDB.pm line 215):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor max_depth (defined at Devel/PartialDump.pm line 67):13] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor object (defined at KiokuDB/Entry/Skip.pm line 20):12] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor max_elements (defined at Devel/PartialDump.pm line 59):10] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _deferred (defined at KiokuDB/Linker.pm line 58):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor leak_tracker (defined at KiokuDB/LiveObjects.pm line 32):10] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor allow_bases (defined at KiokuDB.pm line 72):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor directory (defined at KiokuDB/Stream/Objects.pm line 8):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor stream (defined at Data/Stream/Bulk/Filter.pm line 22):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor clear_collapser of attribute collapser (defined at KiokuDB.pm line 192):4] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor deleted (defined at KiokuDB/Entry.pm line 36):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor entry_stream (defined at KiokuDB/Stream/Objects.pm line 14):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor is_weak (defined at KiokuDB/Reference.pm line 16):10] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor backend (defined at KiokuDB.pm line 208):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _set_buffer of attribute _buffer (defined at KiokuDB/Collapser.pm line 59):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _set_txn_scope of attribute txn_scope (defined at KiokuDB/LiveObjects.pm line 240):9] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor root (defined at KiokuDB/Entry/Skip.pm line 14):10] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor class (defined at KiokuDB/Entry.pm line 48):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor pair_delim (defined at Devel/PartialDump.pm line 98):10] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _known_scopes (defined at KiokuDB/LiveObjects.pm line 167):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor options (defined at KiokuDB/Collapser/Buffer.pm line 107):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor intrinsic (defined at KiokuDB/TypeMap/Entry/Std/Intrinsic.pm line 10):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _deleted of attribute deleted (defined at KiokuDB/Entry.pm line 36):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB/Collapser.pm line 30):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB/Collapser/Buffer.pm line 9):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB/LiveObjects/Scope.pm line 25):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _id of attribute id (defined at KiokuDB/Entry.pm line 12):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor _queue (defined at KiokuDB/Linker.pm line 52):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor class (defined at KiokuDB/TypeMap/Entry/Compiled.pm line 14):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor intrinsic (defined at KiokuDB/Collapser/Buffer.pm line 76):7] # spent 27µs making 1 call to Eval::Closure::__ANON__[accessor check_class_versions (defined at KiokuDB/TypeMap/Entry/MOP.pm line 28):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor expand_method (defined at KiokuDB/TypeMap/Entry/Compiled.pm line 8):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB/Linker.pm line 22):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor to (defined at KiokuDB/TypeMap/Entry/Alias.pm line 8):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _has_references of attribute _references (defined at KiokuDB/Entry.pm line 129):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor allow_classes (defined at KiokuDB.pm line 72):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor live_objects (defined at KiokuDB/LiveObjects/TXNScope.pm line 16):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor typemaps (defined at KiokuDB/TypeMap/Shadow.pm line 10):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _clear_objects of attribute objects (defined at KiokuDB/LiveObjects/Scope.pm line 12):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _entry_args (defined at KiokuDB/Collapser/Buffer.pm line 44):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor check_class_versions (defined at KiokuDB.pm line 142):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor class_meta (defined at KiokuDB/Entry.pm line 55):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor refresh_method (defined at KiokuDB/TypeMap/Entry/Compiled.pm line 8):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor typemap (defined at KiokuDB/TypeMap/Resolver.pm line 13):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _entries (defined at KiokuDB/LiveObjects.pm line 49):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _ids of attribute ids (defined at KiokuDB/Error/MissingObjects.pm line 10):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor collapse_method (defined at KiokuDB/TypeMap/Entry/Compiled.pm line 8):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor object (defined at KiokuDB/Entry.pm line 100):9] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor pairs (defined at Devel/PartialDump.pm line 80):10] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _objects (defined at KiokuDB/LiveObjects.pm line 49):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor entry (defined at KiokuDB/TypeMap/Entry/Compiled.pm line 20):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor queue (defined at KiokuDB/Linker.pm line 42):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor version_table (defined at KiokuDB/TypeMap/Entry/MOP.pm line 38):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _object_entries (defined at KiokuDB/LiveObjects.pm line 49):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor write_upgrades (defined at KiokuDB/TypeMap/Entry/MOP.pm line 46):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _ids (defined at KiokuDB/LiveObjects.pm line 57):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor allow_class_builders (defined at KiokuDB.pm line 67):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor class_version (defined at KiokuDB/Entry.pm line 62):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _clear_referenced_ids of attribute _referenced_ids (defined at KiokuDB/Entry.pm line 172):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor backend (defined at KiokuDB/Linker.pm line 29):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor id_method (defined at KiokuDB/TypeMap/Entry/Compiled.pm line 8):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor txn_scope (defined at KiokuDB/LiveObjects.pm line 240):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor clear_linker of attribute linker (defined at KiokuDB.pm line 221):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor has_intrinsic of attribute intrinsic (defined at KiokuDB/TypeMap/Entry/Std/Intrinsic.pm line 10):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _buffer (defined at KiokuDB/Collapser.pm line 59):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor first_class (defined at KiokuDB/Collapser/Buffer.pm line 101):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor prev (defined at KiokuDB/Entry/Skip.pm line 8):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _objects (defined at KiokuDB/Collapser/Buffer.pm line 19):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor simple_entries (defined at KiokuDB/Collapser/Buffer.pm line 93):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor cache (defined at KiokuDB/LiveObjects.pm line 27):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor tied (defined at KiokuDB/Entry.pm line 71):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor has_max_length of attribute max_length (defined at Devel/PartialDump.pm line 52):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor class_version_table (defined at KiokuDB.pm line 152):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor clear_root of attribute root (defined at KiokuDB/Entry.pm line 20):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor has_linker of attribute linker (defined at KiokuDB/Stream/Objects.pm line 21):4] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor _objects of attribute objects (defined at KiokuDB/Error/UnknownObjects.pm line 10):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor parent (defined at KiokuDB/LiveObjects/Scope.pm line 20):7] # spent 26µs making 1 call to Eval::Closure::__ANON__[accessor typemap_resolver (defined at KiokuDB/Collapser.pm line 42):7] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_max_length of attribute max_length (defined at Devel/PartialDump.pm line 52):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_value of attribute value (defined at KiokuDB/Thunk.pm line 24):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_live_objects of attribute live_objects (defined at KiokuDB/Stream/Objects.pm line 33):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor streams (defined at Data/Stream/Bulk/Cat.pm line 16):7] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_entries of attribute entries (defined at KiokuDB/TypeMap.pm line 16):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[generated method (unknown origin):13] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _clear_scope of attribute _scope (defined at KiokuDB/Stream/Objects.pm line 45):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor class_version_table (defined at KiokuDB/TypeMap/Entry/MOP.pm line 44):7] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_object of attribute object (defined at KiokuDB/Entry/Skip.pm line 20):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _clear_references of attribute _references (defined at KiokuDB/Entry.pm line 129):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_max_elements of attribute max_elements (defined at Devel/PartialDump.pm line 59):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _clear_buffer of attribute _buffer (defined at KiokuDB/Collapser.pm line 59):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_id of attribute id (defined at KiokuDB/Entry.pm line 12):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_isa_entries of attribute isa_entries (defined at KiokuDB/TypeMap.pm line 16):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_linker of attribute linker (defined at KiokuDB/Stream/Objects.pm line 21):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_collapser of attribute collapser (defined at KiokuDB.pm line 192):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_value of attribute value (defined at KiokuDB/Thunk.pm line 24):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_entries of attribute entries (defined at KiokuDB/TypeMap.pm line 16):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _clear_current_scope of attribute current_scope (defined at KiokuDB/LiveObjects.pm line 155):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_live_objects of attribute live_objects (defined at KiokuDB/Stream/Objects.pm line 33):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_all_isa_entries of attribute all_isa_entries (defined at KiokuDB/TypeMap.pm line 25):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_prev of attribute prev (defined at KiokuDB/Entry.pm line 83):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_class_version of attribute class_version (defined at KiokuDB/Entry.pm line 62):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _clear_live_objects of attribute live_objects (defined at KiokuDB/LiveObjects/Scope.pm line 25):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_max_elements of attribute max_elements (defined at Devel/PartialDump.pm line 59):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_class_meta of attribute class_meta (defined at KiokuDB/Entry.pm line 55):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor backend_data (defined at KiokuDB/Entry.pm line 77):7] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_all_entries of attribute all_entries (defined at KiokuDB/TypeMap.pm line 25):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_prev of attribute prev (defined at KiokuDB/Entry.pm line 83):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor _data of attribute data (defined at KiokuDB/Entry.pm line 42):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_all_isa_entry_classes of attribute all_isa_entry_classes (defined at KiokuDB/TypeMap.pm line 31):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_class of attribute class (defined at KiokuDB/Entry.pm line 48):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_typemap_resolver of attribute typemap_resolver (defined at KiokuDB.pm line 154):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor data (defined at KiokuDB/Entry.pm line 42):7] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor has_all_entries of attribute all_entries (defined at KiokuDB/TypeMap.pm line 25):4] # spent 25µs making 1 call to Eval::Closure::__ANON__[accessor clear_backend_data of attribute backend_data (defined at KiokuDB/Entry.pm line 77):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor _clear_txn_scope of attribute txn_scope (defined at KiokuDB/LiveObjects.pm line 240):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor has_linker of attribute linker (defined at KiokuDB.pm line 221):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor has_backend_data of attribute backend_data (defined at KiokuDB/Entry.pm line 77):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor has_root of attribute root (defined at KiokuDB/Entry/Skip.pm line 14):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor clear_merged_typemap of attribute merged_typemap (defined at KiokuDB.pm line 77):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor has_data of attribute data (defined at KiokuDB/Entry.pm line 42):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor has_tied of attribute tied (defined at KiokuDB/Entry.pm line 71):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor clear_leak_tracker of attribute leak_tracker (defined at KiokuDB/LiveObjects.pm line 32):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor clear_includes of attribute includes (defined at KiokuDB/TypeMap.pm line 37):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor clear_object of attribute object (defined at KiokuDB/Entry.pm line 100):4] # spent 24µs making 1 call to Eval::Closure::__ANON__[accessor _tied of attribute tied (defined at KiokuDB/Entry.pm line 71):4] # spent 21µ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 241ms (227+14.3) within Eval::Closure::_make_compiler which was called 350 times, avg 689µs/call: # 350 times (227ms+14.3ms) by Memoize::_memoizer at line 269 of Memoize.pm, avg 689µs/call
sub _make_compiler {
1081750221ms local $@;
109 local $SIG{__DIE__};
11035014.0ms my $compiler = eval _make_compiler_source(@_);
# spent 14.0ms making 350 calls to Eval::Closure::_make_compiler_source, avg 40µs/call
# spent 2.60ms executing statements in 249 string evals (merged)
111 my $e = $@;
112 return ($compiler, $e);
113}
114114µs1844µsmemoize('_make_compiler');
# spent 844µs making 1 call to Memoize::memoize
115
116
# spent 14.0ms within Eval::Closure::_make_compiler_source which was called 350 times, avg 40µs/call: # 350 times (14.0ms+0s) by Eval::Closure::_make_compiler at line 110, avg 40µs/call
sub _make_compiler_source {
117105015.2ms 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
129sub _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
147111µs1;
148
149__END__