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

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose.pm
StatementsExecuted 1440 statements in 31.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11120.9ms30.1msMoose::::BEGIN@15Moose::BEGIN@15
11113.0ms91.3msMoose::::BEGIN@27Moose::BEGIN@27
11110.9ms109msMoose::::BEGIN@19Moose::BEGIN@19
11110.9ms48.4msMoose::::BEGIN@20Moose::BEGIN@20
451110.6ms697msMoose::::init_metaMoose::init_meta
10051276.68ms10.2sMoose::::hasMoose::has
1115.61ms11.8msMoose::::BEGIN@30Moose::BEGIN@30
1114.32ms13.3msMoose::::BEGIN@31Moose::BEGIN@31
1113.57ms7.45msMoose::::BEGIN@32Moose::BEGIN@32
1113.56ms20.2msMoose::::BEGIN@25Moose::BEGIN@25
10654403.30ms5.36sMoose::::withMoose::with (recurses: max depth 1, inclusive time 91.9ms)
1113.17ms13.7msMoose::::BEGIN@28Moose::BEGIN@28
1112.67ms384msMoose::::BEGIN@21Moose::BEGIN@21
1112.58ms10.3msMoose::::BEGIN@29Moose::BEGIN@29
1111.54ms12.0msMoose::::BEGIN@38Moose::BEGIN@38
1111.51ms7.64msMoose::::BEGIN@33Moose::BEGIN@33
111984µs2.08msMoose::::BEGIN@14Moose::BEGIN@14
111936µs10.4msMoose::::BEGIN@23Moose::BEGIN@23
644260µs37.0msMoose::::extendsMoose::extends
111103µs122µsMoose::::BEGIN@2Moose::BEGIN@2
11192µs92µsMoose::::BEGIN@5Moose::BEGIN@5
11183µs8.74msMoose::::BEGIN@35Moose::BEGIN@35
11179µs163µsMoose::::BEGIN@17Moose::BEGIN@17
22271µs4.07msMoose::::aroundMoose::around
11155µs230µsMoose::::BEGIN@11Moose::BEGIN@11
11140µs108µsMoose::::BEGIN@3Moose::BEGIN@3
11137µs167µsMoose::::BEGIN@12Moose::BEGIN@12
11127µs27µsMoose::::BEGIN@22Moose::BEGIN@22
11124µs24µsMoose::::BEGIN@36Moose::BEGIN@36
0000s0sMoose::::_get_callerMoose::_get_caller
0000s0sMoose::::afterMoose::after
0000s0sMoose::::augmentMoose::augment
0000s0sMoose::::beforeMoose::before
0000s0sMoose::::innerMoose::inner
0000s0sMoose::::overrideMoose::override
0000s0sMoose::::superMoose::super
0000s0sMoose::::throw_errorMoose::throw_error
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose;
23106µs2140µs
# spent 122µs (103+18) within Moose::BEGIN@2 which was called: # once (103µs+18µs) by MooseX::Types::BEGIN@2 at line 2
use strict;
# spent 122µs making 1 call to Moose::BEGIN@2 # spent 18µs making 1 call to strict::import
33287µs2177µs
# spent 108µs (40+69) within Moose::BEGIN@3 which was called: # once (40µs+69µs) by MooseX::Types::BEGIN@2 at line 3
use warnings;
# spent 108µs making 1 call to Moose::BEGIN@3 # spent 69µs making 1 call to warnings::import
4
53286µs192µs
# spent 92µs within Moose::BEGIN@5 which was called: # once (92µs+0s) by MooseX::Types::BEGIN@2 at line 5
use 5.008;
# spent 92µs making 1 call to Moose::BEGIN@5
6
715µsour $VERSION = '1.19';
8171µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
913µsour $AUTHORITY = 'cpan:STEVAN';
10
113117µs2406µs
# spent 230µs (55+175) within Moose::BEGIN@11 which was called: # once (55µs+175µs) by MooseX::Types::BEGIN@2 at line 11
use Scalar::Util 'blessed';
# spent 230µs making 1 call to Moose::BEGIN@11 # spent 175µs making 1 call to Exporter::import
12394µs2297µs
# spent 167µs (37+130) within Moose::BEGIN@12 which was called: # once (37µs+130µs) by MooseX::Types::BEGIN@2 at line 12
use Carp 'confess';
# spent 167µs making 1 call to Moose::BEGIN@12 # spent 130µs making 1 call to Exporter::import
13
143464µs22.12ms
# spent 2.08ms (984µs+1.10) within Moose::BEGIN@14 which was called: # once (984µs+1.10ms) by MooseX::Types::BEGIN@2 at line 14
use Moose::Deprecated;
# spent 2.08ms making 1 call to Moose::BEGIN@14 # spent 36µs making 1 call to Package::DeprecationManager::__ANON__[Package/DeprecationManager.pm:61]
153571µs230.3ms
# spent 30.1ms (20.9+9.19) within Moose::BEGIN@15 which was called: # once (20.9ms+9.19ms) by MooseX::Types::BEGIN@2 at line 15
use Moose::Exporter;
# spent 30.1ms making 1 call to Moose::BEGIN@15 # spent 195µs making 1 call to Moose::Exporter::import
16
173291µs2247µs
# spent 163µs (79+84) within Moose::BEGIN@17 which was called: # once (79µs+84µs) by MooseX::Types::BEGIN@2 at line 17
use Class::MOP 1.10;
# spent 163µs making 1 call to Moose::BEGIN@17 # spent 84µs making 1 call to UNIVERSAL::VERSION
18
193724µs1109ms
# spent 109ms (10.9+97.6) within Moose::BEGIN@19 which was called: # once (10.9ms+97.6ms) by MooseX::Types::BEGIN@2 at line 19
use Moose::Meta::Class;
# spent 109ms making 1 call to Moose::BEGIN@19
203663µs148.4ms
# spent 48.4ms (10.9+37.5) within Moose::BEGIN@20 which was called: # once (10.9ms+37.5ms) by MooseX::Types::BEGIN@2 at line 20
use Moose::Meta::TypeConstraint;
# spent 48.4ms making 1 call to Moose::BEGIN@20
213497µs1384ms
# spent 384ms (2.67+381) within Moose::BEGIN@21 which was called: # once (2.67ms+381ms) by MooseX::Types::BEGIN@2 at line 21
use Moose::Meta::TypeCoercion;
# spent 384ms making 1 call to Moose::BEGIN@21
22390µs127µs
# spent 27µs within Moose::BEGIN@22 which was called: # once (27µs+0s) by MooseX::Types::BEGIN@2 at line 22
use Moose::Meta::Attribute;
# spent 27µs making 1 call to Moose::BEGIN@22
233586µs110.4ms
# spent 10.4ms (936µs+9.43) within Moose::BEGIN@23 which was called: # once (936µs+9.43ms) by MooseX::Types::BEGIN@2 at line 23
use Moose::Meta::Instance;
# spent 10.4ms making 1 call to Moose::BEGIN@23
24
253480µs120.2ms
# spent 20.2ms (3.56+16.6) within Moose::BEGIN@25 which was called: # once (3.56ms+16.6ms) by MooseX::Types::BEGIN@2 at line 25
use Moose::Object;
# spent 20.2ms making 1 call to Moose::BEGIN@25
26
273507µs191.3ms
# spent 91.3ms (13.0+78.3) within Moose::BEGIN@27 which was called: # once (13.0ms+78.3ms) by MooseX::Types::BEGIN@2 at line 27
use Moose::Meta::Role;
# spent 91.3ms making 1 call to Moose::BEGIN@27
283574µs113.7ms
# spent 13.7ms (3.17+10.6) within Moose::BEGIN@28 which was called: # once (3.17ms+10.6ms) by MooseX::Types::BEGIN@2 at line 28
use Moose::Meta::Role::Composite;
# spent 13.7ms making 1 call to Moose::BEGIN@28
293524µs110.3ms
# spent 10.3ms (2.58+7.75) within Moose::BEGIN@29 which was called: # once (2.58ms+7.75ms) by MooseX::Types::BEGIN@2 at line 29
use Moose::Meta::Role::Application;
# spent 10.3ms making 1 call to Moose::BEGIN@29
303519µs111.8ms
# spent 11.8ms (5.61+6.19) within Moose::BEGIN@30 which was called: # once (5.61ms+6.19ms) by MooseX::Types::BEGIN@2 at line 30
use Moose::Meta::Role::Application::RoleSummation;
# spent 11.8ms making 1 call to Moose::BEGIN@30
313520µs113.3ms
# spent 13.3ms (4.32+9.03) within Moose::BEGIN@31 which was called: # once (4.32ms+9.03ms) by MooseX::Types::BEGIN@2 at line 31
use Moose::Meta::Role::Application::ToClass;
# spent 13.3ms making 1 call to Moose::BEGIN@31
323510µs17.45ms
# spent 7.45ms (3.57+3.89) within Moose::BEGIN@32 which was called: # once (3.57ms+3.89ms) by MooseX::Types::BEGIN@2 at line 32
use Moose::Meta::Role::Application::ToRole;
# spent 7.45ms making 1 call to Moose::BEGIN@32
333522µs17.64ms
# spent 7.64ms (1.51+6.13) within Moose::BEGIN@33 which was called: # once (1.51ms+6.13ms) by MooseX::Types::BEGIN@2 at line 33
use Moose::Meta::Role::Application::ToInstance;
# spent 7.64ms making 1 call to Moose::BEGIN@33
34
353156µs217.4ms
# spent 8.74ms (83µs+8.66) within Moose::BEGIN@35 which was called: # once (83µs+8.66ms) by MooseX::Types::BEGIN@2 at line 35
use Moose::Util::TypeConstraints;
# spent 8.74ms making 1 call to Moose::BEGIN@35 # spent 8.66ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
36390µs124µs
# spent 24µs within Moose::BEGIN@36 which was called: # once (24µs+0s) by MooseX::Types::BEGIN@2 at line 36
use Moose::Util ();
# spent 24µs making 1 call to Moose::BEGIN@36
37
3834.21ms112.0ms
# spent 12.0ms (1.54+10.5) within Moose::BEGIN@38 which was called: # once (1.54ms+10.5ms) by MooseX::Types::BEGIN@2 at line 38
use Moose::Meta::Attribute::Native;
# spent 12.0ms making 1 call to Moose::BEGIN@38
39
40sub throw_error {
41 # FIXME This
42 shift;
43 goto \&confess
44}
45
46
# spent 37.0ms (260µs+36.7) within Moose::extends which was called 6 times, avg 6.16ms/call: # 3 times (120µs+18.2ms) by Moose::extends at line 359 of Moose/Exporter.pm, avg 6.10ms/call # once (65µs+7.81ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@7 at line 3 of MooseX/Role/Parameterized/Meta/Role/Parameterized.pm # once (37µs+5.37ms) by MooseX::Role::Parameterized::BEGIN@8 at line 3 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (38µs+5.32ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@8 at line 3 of MooseX/Role/Parameterized/Meta/Parameter.pm
sub extends {
479102µs my $meta = shift;
48
49 Moose->throw_error("Must derive at least one class") unless @_;
50
51 # this checks the metaclass to make sure
52 # it is correct, sometimes it can get out
53 # of sync when the classes are being built
54318.2ms $meta->superclasses(@_);
# spent 18.2ms making 3 calls to Moose::Meta::Class::superclasses, avg 6.06ms/call
55}
56
57
# spent 5.36s (3.30ms+5.36) within Moose::with which was called 106 times, avg 50.6ms/call: # 53 times (1.12ms+2.63s) by Moose::with at line 359 of Moose/Exporter.pm, avg 49.7ms/call # once (39µs+470ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@10 at line 13 of Markdent/Event/StartDocument.pm # once (48µs+337ms) by Markdent::Simple::Document::BEGIN@9 at line 15 of Markdent/Handler/HTMLStream/Document.pm # once (43µs+205ms) by Markdent::Parser::BEGIN@10 at line 36 of Markdent/Dialect/Standard/BlockParser.pm # once (38µs+123ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 23 of Markdent/Event/EndCode.pm # once (55µs+92.0ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@7 at line 4 of MooseX/Role/Parameterized/Meta/Role/Parameterized.pm # once (49µs+87.2ms) by Markdent::Parser::BEGIN@11 at line 36 of Markdent/Dialect/Standard/SpanParser.pm # once (41µs+41.0ms) by Markdent::Simple::Document::BEGIN@10 at line 21 of Markdent/Parser.pm # once (39µs+39.7ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 25 of Markdent/Event/EndCode.pm # once (52µs+37.8ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@24 at line 27 of Markdent/Event/StartHTMLTag.pm # once (39µs+36.1ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 33 of Markdent/Event/Text.pm # once (39µs+36.0ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 45 of Markdent/Event/Image.pm # once (40µs+35.9ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@19 at line 13 of Markdent/Event/EndOrderedList.pm # once (54µs+35.9ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@19 at line 21 of Markdent/Event/HTMLEntity.pm # once (40µs+35.7ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@20 at line 27 of Markdent/Event/HTMLTag.pm # once (39µs+35.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 39 of Markdent/Event/StartLink.pm # once (42µs+35.4ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@13 at line 13 of Markdent/Event/EndBlockquote.pm # once (38µs+35.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@12 at line 21 of Markdent/Event/AutoLink.pm # once (41µs+35.3ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@24 at line 13 of Markdent/Event/HorizontalRule.pm # once (40µs+35.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@15 at line 21 of Markdent/Event/EndHTMLTag.pm # once (40µs+35.3ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@26 at line 21 of Markdent/Event/HTMLCommentBlock.pm # once (38µs+35.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 21 of Markdent/Event/StartEmphasis.pm # once (39µs+35.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@16 at line 13 of Markdent/Event/EndLink.pm # once (38µs+35.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 21 of Markdent/Event/EndEmphasis.pm # once (53µs+35.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 21 of Markdent/Event/StartCode.pm # once (39µs+35.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@18 at line 21 of Markdent/Event/HTMLComment.pm # once (43µs+35.2ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@25 at line 21 of Markdent/Event/HTMLBlock.pm # once (38µs+35.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 21 of Markdent/Event/EndStrong.pm # once (40µs+35.1ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@27 at line 21 of Markdent/Event/Preformatted.pm # once (39µs+35.1ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 21 of Markdent/Event/EndCode.pm # once (39µs+35.1ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@17 at line 13 of Markdent/Event/EndListItem.pm # once (39µs+35.1ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@14 at line 21 of Markdent/Event/StartHeader.pm # once (44µs+35.0ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 21 of Markdent/Event/StartStrong.pm # once (39µs+35.0ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@15 at line 21 of Markdent/Event/EndHeader.pm # once (40µs+35.0ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@21 at line 13 of Markdent/Event/EndParagraph.pm # once (40µs+34.7ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@23 at line 13 of Markdent/Event/EndUnorderedList.pm # once (41µs+34.7ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@22 at line 13 of Markdent/Event/StartUnorderedList.pm # once (39µs+34.7ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@20 at line 13 of Markdent/Event/StartParagraph.pm # once (39µs+34.7ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@16 at line 13 of Markdent/Event/StartListItem.pm # once (41µs+34.7ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@18 at line 13 of Markdent/Event/StartOrderedList.pm # once (40µs+34.6ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@12 at line 13 of Markdent/Event/StartBlockquote.pm # once (40µs+34.5ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@11 at line 13 of Markdent/Event/EndDocument.pm # once (45µs+21.1ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 23 of Markdent/Event/EndStrong.pm # once (38µs+20.9ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 23 of Markdent/Event/StartCode.pm # once (38µs+20.8ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 23 of Markdent/Event/EndEmphasis.pm # once (41µs+20.7ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 23 of Markdent/Event/StartStrong.pm # once (38µs+20.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 23 of Markdent/Event/StartEmphasis.pm # once (39µs+20.0ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@16 at line 15 of Markdent/Event/EndLink.pm # once (40µs+20.0ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 41 of Markdent/Event/StartLink.pm # once (52µs+5.18ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 25 of Markdent/Event/EndStrong.pm # once (38µs+5.15ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 25 of Markdent/Event/EndEmphasis.pm # once (38µs+5.05ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 25 of Markdent/Event/StartEmphasis.pm # once (38µs+5.01ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 25 of Markdent/Event/StartStrong.pm # once (39µs+5.01ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 25 of Markdent/Event/StartCode.pm
sub with {
58531.17ms532.63s Moose::Util::apply_all_roles(shift, @_);
# spent 2.72s making 53 calls to Moose::Util::apply_all_roles, avg 51.4ms/call, recursion: max depth 1, sum of overlapping time 91.9ms
59}
60
61
# spent 10.2s (6.68ms+10.2) within Moose::has which was called 100 times, avg 102ms/call: # 50 times (4.57ms+5.10s) by Moose::has at line 359 of Moose/Exporter.pm, avg 102ms/call # once (43µs+1.71s) by Markdent::Parser::BEGIN@11 at line 43 of Markdent/Dialect/Standard/SpanParser.pm # once (45µs+1.19s) by Markdent::Parser::BEGIN@10 at line 43 of Markdent/Dialect/Standard/BlockParser.pm # once (42µs+820ms) by Markdent::Parser::BEGIN@11 at line 51 of Markdent/Dialect/Standard/SpanParser.pm # once (40µs+472ms) by Markdent::Parser::BEGIN@10 at line 50 of Markdent/Dialect/Standard/BlockParser.pm # once (40µs+442ms) by Markdent::Parser::BEGIN@10 at line 62 of Markdent/Dialect/Standard/BlockParser.pm # once (43µs+32.9ms) by Markdent::Parser::BEGIN@11 at line 69 of Markdent/Dialect/Standard/SpanParser.pm # once (41µs+17.0ms) by Markdent::Simple::Document::BEGIN@10 at line 44 of Markdent/Parser.pm # once (40µs+17.0ms) by Markdent::Simple::Document::BEGIN@10 at line 51 of Markdent/Parser.pm # once (45µs+16.9ms) by Markdent::Simple::Document::BEGIN@10 at line 23 of Markdent/Parser.pm # once (41µs+16.9ms) by Markdent::Simple::Document::BEGIN@10 at line 38 of Markdent/Parser.pm # once (41µs+14.0ms) by MooseX::Role::Parameterized::BEGIN@8 at line 32 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (42µs+14.0ms) by Markdent::Parser::BEGIN@11 at line 84 of Markdent/Dialect/Standard/SpanParser.pm # once (41µs+13.9ms) by Markdent::Simple::Document::BEGIN@10 at line 57 of Markdent/Parser.pm # once (43µs+13.7ms) by Markdent::Simple::Document::BEGIN@10 at line 30 of Markdent/Parser.pm # once (42µs+13.7ms) by Markdent::Parser::BEGIN@11 at line 76 of Markdent/Dialect/Standard/SpanParser.pm # once (37µs+13.0ms) by MooseX::Role::Parameterized::BEGIN@8 at line 37 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (51µs+12.2ms) by Markdent::Simple::Document::BEGIN@9 at line 17 of Markdent/Handler/HTMLStream/Document.pm # once (40µs+10.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 27 of Markdent/Event/Text.pm # once (44µs+10.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 27 of Markdent/Event/Image.pm # once (43µs+10.5ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 21 of Markdent/Event/Text.pm # once (40µs+10.5ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 27 of Markdent/Event/StartLink.pm # once (40µs+10.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 33 of Markdent/Event/Image.pm # once (39µs+10.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 21 of Markdent/Event/StartLink.pm # once (40µs+9.53ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@20 at line 25 of Markdent/Event/HTMLTag.pm # once (40µs+9.00ms) by MooseX::Role::Parameterized::BEGIN@8 at line 14 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (48µs+8.93ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@19 at line 15 of Markdent/Event/HTMLEntity.pm # once (43µs+8.21ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@24 at line 25 of Markdent/Event/StartHTMLTag.pm # once (39µs+7.90ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 39 of Markdent/Event/Image.pm # once (39µs+7.86ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 33 of Markdent/Event/StartLink.pm # once (41µs+7.85ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 21 of Markdent/Event/Image.pm # once (43µs+7.71ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 15 of Markdent/Event/EndCode.pm # once (42µs+7.71ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 15 of Markdent/Event/EndStrong.pm # once (43µs+7.70ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 15 of Markdent/Event/StartEmphasis.pm # once (42µs+7.69ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@18 at line 15 of Markdent/Event/HTMLComment.pm # once (49µs+7.69ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 15 of Markdent/Event/StartCode.pm # once (42µs+7.69ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@24 at line 15 of Markdent/Event/StartHTMLTag.pm # once (44µs+7.69ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@15 at line 15 of Markdent/Event/EndHTMLTag.pm # once (42µs+7.68ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 15 of Markdent/Event/EndEmphasis.pm # once (41µs+7.67ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 15 of Markdent/Event/StartLink.pm # once (43µs+7.67ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 15 of Markdent/Event/Image.pm # once (42µs+7.66ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@20 at line 15 of Markdent/Event/HTMLTag.pm # once (48µs+7.65ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@25 at line 15 of Markdent/Event/HTMLBlock.pm # once (42µs+7.65ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@26 at line 15 of Markdent/Event/HTMLCommentBlock.pm # once (42µs+7.64ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 15 of Markdent/Event/StartStrong.pm # once (43µs+7.64ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 15 of Markdent/Event/Text.pm # once (42µs+7.64ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@27 at line 15 of Markdent/Event/Preformatted.pm # once (42µs+7.61ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@15 at line 15 of Markdent/Event/EndHeader.pm # once (44µs+7.57ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@12 at line 15 of Markdent/Event/AutoLink.pm # once (42µs+7.56ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@14 at line 15 of Markdent/Event/StartHeader.pm # once (39µs+5.41ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@8 at line 9 of MooseX/Role/Parameterized/Meta/Parameter.pm
sub has {
623504.38ms my $meta = shift;
63 my $name = shift;
64
65 Moose->throw_error('Usage: has \'name\' => ( key => value, ... )')
66 if @_ % 2 == 1;
67
68502.12ms my %options = ( definition_context => Moose::Util::_caller_info(), @_ );
# spent 2.12ms making 50 calls to Moose::Util::_caller_info, avg 42µs/call
69 my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
70505.10s $meta->add_attribute( $_, %options ) for @$attrs;
# spent 5.10s making 50 calls to Moose::Meta::Class::add_attribute, avg 102ms/call
71}
72
73sub before {
74 Moose::Util::add_method_modifier(shift, 'before', \@_);
75}
76
77sub after {
78 Moose::Util::add_method_modifier(shift, 'after', \@_);
79}
80
81
# spent 4.07ms (71µs+4.00) within Moose::around which was called 2 times, avg 2.04ms/call: # once (46µs+2.04ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@8 at line 20 of MooseX/Role/Parameterized/Meta/Parameter.pm # once (25µs+1.96ms) by Moose::around at line 359 of Moose/Exporter.pm
sub around {
82125µs11.96ms Moose::Util::add_method_modifier(shift, 'around', \@_);
# spent 1.96ms making 1 call to Moose::Util::add_method_modifier
83}
84
8512µsour $SUPER_PACKAGE;
8612µsour $SUPER_BODY;
8713µsour @SUPER_ARGS;
88
89sub super {
90 # This check avoids a recursion loop - see
91 # t/100_bugs/020_super_recursion.t
92 return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller();
93 return unless $SUPER_BODY; $SUPER_BODY->(@SUPER_ARGS);
94}
95
96sub override {
97 my $meta = shift;
98 my ( $name, $method ) = @_;
99 $meta->add_override_method_modifier( $name => $method );
100}
101
102sub inner {
103 my $pkg = caller();
104 our ( %INNER_BODY, %INNER_ARGS );
105
106 if ( my $body = $INNER_BODY{$pkg} ) {
107 my @args = @{ $INNER_ARGS{$pkg} };
108 local $INNER_ARGS{$pkg};
109 local $INNER_BODY{$pkg};
110 return $body->(@args);
111 } else {
112 return;
113 }
114}
115
116sub augment {
117 my $meta = shift;
118 my ( $name, $method ) = @_;
119 $meta->add_augment_method_modifier( $name => $method );
120}
121
122136µs14.74msMoose::Exporter->setup_import_methods(
# spent 4.74ms making 1 call to Moose::Exporter::setup_import_methods
123 with_meta => [
124 qw( extends with has before after around override augment )
125 ],
126 as_is => [
127 qw( super inner ),
128 \&Carp::confess,
129 \&Scalar::Util::blessed,
130 ],
131);
132
133
# spent 697ms (10.6+686) within Moose::init_meta which was called 45 times, avg 15.5ms/call: # 45 times (10.6ms+686ms) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] at line 423 of Moose/Exporter.pm, avg 15.5ms/call
sub init_meta {
134 # This used to be called as a function. This hack preserves
135 # backwards compatibility.
1366307.19ms if ( $_[0] ne __PACKAGE__ ) {
137 Moose::Deprecated::deprecated(
138 feature => 'Moose::init_meta',
139 message => 'Calling Moose::init_meta as a function is deprecated',
140 );
141
142 return __PACKAGE__->init_meta(
143 for_class => $_[0],
144 base_class => $_[1],
145 metaclass => $_[2],
146 );
147 }
148
149 shift;
150 my %args = @_;
151
152 my $class = $args{for_class}
153 or Moose->throw_error("Cannot call init_meta without specifying a for_class");
154 my $base_class = $args{base_class} || 'Moose::Object';
155 my $metaclass = $args{metaclass} || 'Moose::Meta::Class';
156 my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta';
157
15845504µs Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Class.")
# spent 504µs making 45 calls to UNIVERSAL::isa, avg 11µs/call
159 unless $metaclass->isa('Moose::Meta::Class');
160
161 # make a subtype for each Moose class
1629041.5ms class_type($class)
# spent 37.2ms making 45 calls to Moose::Util::TypeConstraints::class_type, avg 827µs/call # spent 4.26ms making 45 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 95µs/call
163 unless find_type_constraint($class);
164
165 my $meta;
166
1671352.51ms45541µs if ( $meta = Class::MOP::get_metaclass_by_name($class) ) {
# spent 541µs making 45 calls to Class::MOP::get_metaclass_by_name, avg 12µs/call
168 unless ( $meta->isa("Moose::Meta::Class") ) {
169 my $error_message = "$class already has a metaclass, but it does not inherit $metaclass ($meta).";
170 if ( $meta->isa('Moose::Meta::Role') ) {
171 Moose->throw_error($error_message . ' You cannot make the same thing a role and a class. Remove either Moose or Moose::Role.');
172 } else {
173 Moose->throw_error($error_message);
174 }
175 }
176 } else {
177 # no metaclass
178
179 # now we check whether our ancestors have metaclass, and if so borrow that
18045821µs my ( undef, @isa ) = @{ mro::get_linear_isa($class) };
# spent 821µs making 45 calls to mro::get_linear_isa, avg 18µs/call
181
182 foreach my $ancestor ( @isa ) {
183 my $ancestor_meta = Class::MOP::get_metaclass_by_name($ancestor) || next;
184
185 my $ancestor_meta_class = $ancestor_meta->_real_ref_name;
186
187 # if we have an ancestor metaclass that inherits $metaclass, we use
188 # that. This is like _fix_metaclass_incompatibility, but we can do it now.
189
190 # the case of having an ancestry is not very common, but arises in
191 # e.g. Reaction
192 unless ( $metaclass->isa( $ancestor_meta_class ) ) {
193 if ( $ancestor_meta_class->isa($metaclass) ) {
194 $metaclass = $ancestor_meta_class;
195 }
196 }
197 }
198
19945213ms $meta = $metaclass->initialize($class);
# spent 213ms making 45 calls to Moose::Meta::Class::initialize, avg 4.74ms/call
200 }
201
2021351.37ms if (defined $meta_name) {
203 # also check for inherited non moose 'meta' method?
2044513.1ms my $existing = $meta->get_method($meta_name);
# spent 13.1ms making 45 calls to Class::MOP::Mixin::HasMethods::get_method, avg 291µs/call
205 if ($existing && !$existing->isa('Class::MOP::Method::Meta')) {
206 Carp::cluck "Moose is overwriting an existing method named "
207 . "$meta_name in class $class with a method "
208 . "which returns the class's metaclass. If this is "
209 . "actually what you want, you should remove the "
210 . "existing method, otherwise, you should rename or "
211 . "disable this generated method using the "
212 . "'-meta_name' option to 'use Moose'.";
213 }
21445125ms $meta->_add_meta_method($meta_name);
# spent 125ms making 45 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.79ms/call
215 }
216
217 # make sure they inherit from Moose::Object
21890291ms $meta->superclasses($base_class)
# spent 291ms making 90 calls to Moose::Meta::Class::superclasses, avg 3.24ms/call
219 unless $meta->superclasses();
220
221 return $meta;
222}
223
224# This may be used in some older MooseX extensions.
225sub _get_caller {
226 goto &Moose::Exporter::_get_caller;
227}
228
229## make 'em all immutable
230
23122137µs$_->make_immutable(
# spent 137µs making 22 calls to Class::MOP::Class::is_mutable, avg 6µs/call
232 inline_constructor => 1,
233 constructor_name => "_new",
234 # these are Class::MOP accessors, so they need inlining
235 inline_accessors => 1
236451.08ms44319ms ) for grep { $_->is_mutable }
# spent 305ms making 22 calls to Class::MOP::Class::make_immutable, avg 13.9ms/call # spent 13.4ms making 10 calls to Class::MOP::Object::meta, avg 1.34ms/call # spent 148µs making 2 calls to Moose::Meta::Role::Method::Required::meta, avg 74µs/call # spent 81µs making 1 call to Moose::Meta::Role::meta # spent 78µs making 1 call to Moose::Meta::TypeCoercion::Union::meta # spent 77µs making 1 call to Moose::Meta::Role::Application::ToRole::meta # spent 70µs making 1 call to Class::MOP::Mixin::meta # spent 69µs making 1 call to Moose::Meta::Role::Composite::meta # spent 69µs making 1 call to Moose::Meta::Role::Application::RoleSummation::meta # spent 69µs making 1 call to Moose::Meta::TypeCoercion::meta # spent 68µs making 1 call to Moose::Meta::Role::Application::ToClass::meta # spent 68µs making 1 call to Moose::Meta::Role::Application::ToInstance::meta # spent 68µs making 1 call to Moose::Meta::Role::Application::meta
237 map { $_->meta }
238 qw(
239 Moose::Meta::Attribute
240 Moose::Meta::Class
241 Moose::Meta::Instance
242
243 Moose::Meta::TypeCoercion
244 Moose::Meta::TypeCoercion::Union
245
246 Moose::Meta::Method
247 Moose::Meta::Method::Accessor
248 Moose::Meta::Method::Constructor
249 Moose::Meta::Method::Destructor
250 Moose::Meta::Method::Overridden
251 Moose::Meta::Method::Augmented
252
253 Moose::Meta::Role
254 Moose::Meta::Role::Attribute
255 Moose::Meta::Role::Method
256 Moose::Meta::Role::Method::Required
257 Moose::Meta::Role::Method::Conflicting
258
259 Moose::Meta::Role::Composite
260
261 Moose::Meta::Role::Application
262 Moose::Meta::Role::Application::RoleSummation
263 Moose::Meta::Role::Application::ToClass
264 Moose::Meta::Role::Application::ToRole
265 Moose::Meta::Role::Application::ToInstance
26612µs);
267
268124µs235.1msMoose::Meta::Mixin::AttributeCore->meta->make_immutable(
# spent 35.0ms making 1 call to Class::MOP::Class::make_immutable # spent 76µs making 1 call to Class::MOP::Mixin::meta
269 inline_constructor => 0,
270 constructor_name => undef,
271);
272
273158µs1;
274
275__END__