← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 22:00:36 2010
Reported on Wed Nov 17 22:10:49 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose.pm
StatementsExecuted 1440 statements in 30.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11113.2ms88.9msMoose::::BEGIN@27Moose::BEGIN@27
11112.9ms91.7msMoose::::BEGIN@19Moose::BEGIN@19
11111.7ms19.7msMoose::::BEGIN@15Moose::BEGIN@15
451110.4ms618msMoose::::init_metaMoose::init_meta
10051276.81ms5.17sMoose::::hasMoose::has
1116.66ms41.0msMoose::::BEGIN@20Moose::BEGIN@20
1115.69ms11.3msMoose::::BEGIN@30Moose::BEGIN@30
1114.18ms12.7msMoose::::BEGIN@31Moose::BEGIN@31
10654403.83ms4.60sMoose::::withMoose::with (recurses: max depth 1, inclusive time 74.7ms)
1113.53ms7.02msMoose::::BEGIN@32Moose::BEGIN@32
1113.38ms19.4msMoose::::BEGIN@25Moose::BEGIN@25
1113.37ms10.6msMoose::::BEGIN@29Moose::BEGIN@29
1113.17ms13.2msMoose::::BEGIN@28Moose::BEGIN@28
1112.92ms426msMoose::::BEGIN@21Moose::BEGIN@21
1111.48ms8.75msMoose::::BEGIN@38Moose::BEGIN@38
1111.47ms7.08msMoose::::BEGIN@33Moose::BEGIN@33
1111.04ms2.11msMoose::::BEGIN@14Moose::BEGIN@14
111954µs8.44msMoose::::BEGIN@23Moose::BEGIN@23
644224µs30.6msMoose::::extendsMoose::extends
11188µs88µsMoose::::BEGIN@5Moose::BEGIN@5
22273µs3.30msMoose::::aroundMoose::around
11164µs82µsMoose::::BEGIN@2Moose::BEGIN@2
11152µs109µsMoose::::BEGIN@17Moose::BEGIN@17
11144µs8.41msMoose::::BEGIN@35Moose::BEGIN@35
11140µs199µsMoose::::BEGIN@11Moose::BEGIN@11
11139µs108µsMoose::::BEGIN@3Moose::BEGIN@3
11136µs163µsMoose::::BEGIN@12Moose::BEGIN@12
11128µs28µ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;
2399µs2101µs
# spent 82µs (64+19) within Moose::BEGIN@2 which was called: # once (64µs+19µs) by MooseX::Types::BEGIN@2 at line 2
use strict;
# spent 82µs making 1 call to Moose::BEGIN@2 # spent 19µs making 1 call to strict::import
3390µs2177µs
# spent 108µs (39+69) within Moose::BEGIN@3 which was called: # once (39µ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
53259µs188µs
# spent 88µs within Moose::BEGIN@5 which was called: # once (88µs+0s) by MooseX::Types::BEGIN@2 at line 5
use 5.008;
# spent 88µs making 1 call to Moose::BEGIN@5
6
715µsour $VERSION = '1.19';
8167µs$VERSION = eval $VERSION;
# spent 12µs executing statements in string eval
913µsour $AUTHORITY = 'cpan:STEVAN';
10
113105µs2357µs
# spent 199µs (40+159) within Moose::BEGIN@11 which was called: # once (40µs+159µs) by MooseX::Types::BEGIN@2 at line 11
use Scalar::Util 'blessed';
# spent 199µs making 1 call to Moose::BEGIN@11 # spent 158µs making 1 call to Exporter::import
123114µs2289µs
# spent 163µs (36+126) within Moose::BEGIN@12 which was called: # once (36µs+126µs) by MooseX::Types::BEGIN@2 at line 12
use Carp 'confess';
# spent 163µs making 1 call to Moose::BEGIN@12 # spent 126µs making 1 call to Exporter::import
13
143475µs22.14ms
# spent 2.11ms (1.04+1.07) within Moose::BEGIN@14 which was called: # once (1.04ms+1.07ms) by MooseX::Types::BEGIN@2 at line 14
use Moose::Deprecated;
# spent 2.11ms making 1 call to Moose::BEGIN@14 # spent 34µs making 1 call to Package::DeprecationManager::__ANON__[Package/DeprecationManager.pm:61]
153450µs219.8ms
# spent 19.7ms (11.7+7.95) within Moose::BEGIN@15 which was called: # once (11.7ms+7.95ms) by MooseX::Types::BEGIN@2 at line 15
use Moose::Exporter;
# spent 19.7ms making 1 call to Moose::BEGIN@15 # spent 154µs making 1 call to Moose::Exporter::import
16
173174µs2165µs
# spent 109µs (52+56) within Moose::BEGIN@17 which was called: # once (52µs+56µs) by MooseX::Types::BEGIN@2 at line 17
use Class::MOP 1.10;
# spent 109µs making 1 call to Moose::BEGIN@17 # spent 56µs making 1 call to UNIVERSAL::VERSION
18
193509µs191.7ms
# spent 91.7ms (12.9+78.8) within Moose::BEGIN@19 which was called: # once (12.9ms+78.8ms) by MooseX::Types::BEGIN@2 at line 19
use Moose::Meta::Class;
# spent 91.7ms making 1 call to Moose::BEGIN@19
203585µs141.0ms
# spent 41.0ms (6.66+34.4) within Moose::BEGIN@20 which was called: # once (6.66ms+34.4ms) by MooseX::Types::BEGIN@2 at line 20
use Moose::Meta::TypeConstraint;
# spent 41.0ms making 1 call to Moose::BEGIN@20
213674µs1426ms
# spent 426ms (2.92+423) within Moose::BEGIN@21 which was called: # once (2.92ms+423ms) by MooseX::Types::BEGIN@2 at line 21
use Moose::Meta::TypeCoercion;
# spent 426ms making 1 call to Moose::BEGIN@21
223114µs128µs
# spent 28µs within Moose::BEGIN@22 which was called: # once (28µs+0s) by MooseX::Types::BEGIN@2 at line 22
use Moose::Meta::Attribute;
# spent 28µs making 1 call to Moose::BEGIN@22
233509µs18.44ms
# spent 8.44ms (954µs+7.49) within Moose::BEGIN@23 which was called: # once (954µs+7.49ms) by MooseX::Types::BEGIN@2 at line 23
use Moose::Meta::Instance;
# spent 8.44ms making 1 call to Moose::BEGIN@23
24
253476µs119.4ms
# spent 19.4ms (3.38+16.0) within Moose::BEGIN@25 which was called: # once (3.38ms+16.0ms) by MooseX::Types::BEGIN@2 at line 25
use Moose::Object;
# spent 19.4ms making 1 call to Moose::BEGIN@25
26
273504µs188.9ms
# spent 88.9ms (13.2+75.7) within Moose::BEGIN@27 which was called: # once (13.2ms+75.7ms) by MooseX::Types::BEGIN@2 at line 27
use Moose::Meta::Role;
# spent 88.9ms making 1 call to Moose::BEGIN@27
283600µs113.2ms
# spent 13.2ms (3.17+10.0) within Moose::BEGIN@28 which was called: # once (3.17ms+10.0ms) by MooseX::Types::BEGIN@2 at line 28
use Moose::Meta::Role::Composite;
# spent 13.2ms making 1 call to Moose::BEGIN@28
293511µs110.6ms
# spent 10.6ms (3.37+7.19) within Moose::BEGIN@29 which was called: # once (3.37ms+7.19ms) by MooseX::Types::BEGIN@2 at line 29
use Moose::Meta::Role::Application;
# spent 10.6ms making 1 call to Moose::BEGIN@29
303523µs111.3ms
# spent 11.3ms (5.69+5.65) within Moose::BEGIN@30 which was called: # once (5.69ms+5.65ms) by MooseX::Types::BEGIN@2 at line 30
use Moose::Meta::Role::Application::RoleSummation;
# spent 11.3ms making 1 call to Moose::BEGIN@30
313486µs112.7ms
# spent 12.7ms (4.18+8.54) within Moose::BEGIN@31 which was called: # once (4.18ms+8.54ms) by MooseX::Types::BEGIN@2 at line 31
use Moose::Meta::Role::Application::ToClass;
# spent 12.7ms making 1 call to Moose::BEGIN@31
323556µs17.02ms
# spent 7.02ms (3.53+3.50) within Moose::BEGIN@32 which was called: # once (3.53ms+3.50ms) by MooseX::Types::BEGIN@2 at line 32
use Moose::Meta::Role::Application::ToRole;
# spent 7.02ms making 1 call to Moose::BEGIN@32
333471µs17.08ms
# spent 7.08ms (1.47+5.61) within Moose::BEGIN@33 which was called: # once (1.47ms+5.61ms) by MooseX::Types::BEGIN@2 at line 33
use Moose::Meta::Role::Application::ToInstance;
# spent 7.08ms making 1 call to Moose::BEGIN@33
34
353152µs216.8ms
# spent 8.41ms (44µs+8.36) within Moose::BEGIN@35 which was called: # once (44µs+8.36ms) by MooseX::Types::BEGIN@2 at line 35
use Moose::Util::TypeConstraints;
# spent 8.41ms making 1 call to Moose::BEGIN@35 # spent 8.36ms 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.21ms18.75ms
# spent 8.75ms (1.48+7.27) within Moose::BEGIN@38 which was called: # once (1.48ms+7.27ms) by MooseX::Types::BEGIN@2 at line 38
use Moose::Meta::Attribute::Native;
# spent 8.75ms making 1 call to Moose::BEGIN@38
39
40sub throw_error {
41 # FIXME This
42 shift;
43 goto \&confess
44}
45
46
# spent 30.6ms (224µs+30.4) within Moose::extends which was called 6 times, avg 5.11ms/call: # 3 times (101µs+15.1ms) by Moose::extends at line 359 of Moose/Exporter.pm, avg 5.05ms/call # once (38µs+5.57ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@8 at line 3 of MooseX/Role/Parameterized/Meta/Parameter.pm # once (40µs+4.89ms) by MooseX::Role::Parameterized::BEGIN@8 at line 3 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (45µs+4.88ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@7 at line 3 of MooseX/Role/Parameterized/Meta/Role/Parameterized.pm
sub extends {
47989µ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
54315.1ms $meta->superclasses(@_);
# spent 15.1ms making 3 calls to Moose::Meta::Class::superclasses, avg 5.02ms/call
55}
56
57
# spent 4.60s (3.83ms+4.60) within Moose::with which was called 106 times, avg 43.4ms/call: # 53 times (1.10ms+2.26s) by Moose::with at line 359 of Moose/Exporter.pm, avg 42.7ms/call # once (39µs+449ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@10 at line 13 of Markdent/Event/StartDocument.pm # once (62µs+274ms) by Markdent::Simple::Document::BEGIN@9 at line 15 of Markdent/Handler/HTMLStream/Document.pm # once (43µs+151ms) by Markdent::Parser::BEGIN@10 at line 36 of Markdent/Dialect/Standard/BlockParser.pm # once (40µs+103ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 23 of Markdent/Event/EndCode.pm # once (40µs+74.7ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@7 at line 4 of MooseX/Role/Parameterized/Meta/Role/Parameterized.pm # once (46µs+60.1ms) by Markdent::Parser::BEGIN@11 at line 36 of Markdent/Dialect/Standard/SpanParser.pm # once (42µs+34.2ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@20 at line 13 of Markdent/Event/StartParagraph.pm # once (45µs+33.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 45 of Markdent/Event/Image.pm # once (40µs+32.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@24 at line 27 of Markdent/Event/StartHTMLTag.pm # once (41µs+32.0ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@12 at line 21 of Markdent/Event/AutoLink.pm # once (40µs+31.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 39 of Markdent/Event/StartLink.pm # once (50µs+30.9ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@22 at line 13 of Markdent/Event/StartUnorderedList.pm # once (39µs+30.8ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@21 at line 13 of Markdent/Event/EndParagraph.pm # once (39µs+30.7ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 21 of Markdent/Event/StartEmphasis.pm # once (40µs+30.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 21 of Markdent/Event/StartCode.pm # once (40µs+30.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@20 at line 27 of Markdent/Event/HTMLTag.pm # once (306µs+30.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@16 at line 13 of Markdent/Event/EndLink.pm # once (40µs+30.5ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@19 at line 21 of Markdent/Event/HTMLEntity.pm # once (40µs+30.5ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@27 at line 21 of Markdent/Event/Preformatted.pm # once (40µs+30.5ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@26 at line 21 of Markdent/Event/HTMLCommentBlock.pm # once (40µs+30.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 21 of Markdent/Event/StartStrong.pm # once (39µs+30.4ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@15 at line 21 of Markdent/Event/EndHeader.pm # once (41µs+30.4ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@25 at line 21 of Markdent/Event/HTMLBlock.pm # once (40µs+30.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 33 of Markdent/Event/Text.pm # once (40µs+30.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@18 at line 21 of Markdent/Event/HTMLComment.pm # once (41µs+30.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@15 at line 21 of Markdent/Event/EndHTMLTag.pm # once (40µs+30.3ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 21 of Markdent/Event/EndCode.pm # once (41µs+30.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 21 of Markdent/Event/EndEmphasis.pm # once (42µs+30.2ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 21 of Markdent/Event/EndStrong.pm # once (53µs+30.2ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@18 at line 13 of Markdent/Event/StartOrderedList.pm # once (39µs+30.2ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@11 at line 13 of Markdent/Event/EndDocument.pm # once (38µs+30.1ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@16 at line 13 of Markdent/Event/StartListItem.pm # once (39µs+30.0ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@14 at line 21 of Markdent/Event/StartHeader.pm # once (42µs+30.0ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@23 at line 13 of Markdent/Event/EndUnorderedList.pm # once (39µs+30.0ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@24 at line 13 of Markdent/Event/HorizontalRule.pm # once (41µs+30.0ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@19 at line 13 of Markdent/Event/EndOrderedList.pm # once (39µs+29.8ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@13 at line 13 of Markdent/Event/EndBlockquote.pm # once (39µs+29.8ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@12 at line 13 of Markdent/Event/StartBlockquote.pm # once (39µs+29.8ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@17 at line 13 of Markdent/Event/EndListItem.pm # once (40µs+29.1ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 25 of Markdent/Event/EndCode.pm # once (315µs+23.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@16 at line 15 of Markdent/Event/EndLink.pm # once (42µs+23.8ms) by Markdent::Simple::Document::BEGIN@10 at line 21 of Markdent/Parser.pm # once (41µs+20.7ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 23 of Markdent/Event/EndStrong.pm # once (39µs+19.6ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 23 of Markdent/Event/StartEmphasis.pm # once (45µs+19.5ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 23 of Markdent/Event/EndEmphasis.pm # once (40µs+19.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 23 of Markdent/Event/StartStrong.pm # once (38µs+19.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 23 of Markdent/Event/StartCode.pm # once (39µs+18.8ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 41 of Markdent/Event/StartLink.pm # once (39µs+4.83ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 25 of Markdent/Event/StartEmphasis.pm # once (39µs+4.38ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 25 of Markdent/Event/StartCode.pm # once (40µs+4.29ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 25 of Markdent/Event/EndStrong.pm # once (40µs+4.24ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 25 of Markdent/Event/EndEmphasis.pm # once (39µs+4.23ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 25 of Markdent/Event/StartStrong.pm
sub with {
58531.16ms532.26s Moose::Util::apply_all_roles(shift, @_);
# spent 2.34s making 53 calls to Moose::Util::apply_all_roles, avg 44.1ms/call, recursion: max depth 1, sum of overlapping time 74.7ms
59}
60
61
# spent 5.17s (6.81ms+5.16) within Moose::has which was called 100 times, avg 51.7ms/call: # 50 times (4.73ms+2.58s) by Moose::has at line 359 of Moose/Exporter.pm, avg 51.6ms/call # once (44µs+578ms) by Markdent::Parser::BEGIN@10 at line 43 of Markdent/Dialect/Standard/BlockParser.pm # once (45µs+522ms) by Markdent::Parser::BEGIN@11 at line 43 of Markdent/Dialect/Standard/SpanParser.pm # once (41µs+376ms) by Markdent::Parser::BEGIN@11 at line 51 of Markdent/Dialect/Standard/SpanParser.pm # once (41µs+308ms) by Markdent::Parser::BEGIN@10 at line 50 of Markdent/Dialect/Standard/BlockParser.pm # once (40µs+308ms) by Markdent::Parser::BEGIN@10 at line 62 of Markdent/Dialect/Standard/BlockParser.pm # once (42µs+32.8ms) by Markdent::Parser::BEGIN@11 at line 69 of Markdent/Dialect/Standard/SpanParser.pm # once (44µs+17.6ms) by Markdent::Simple::Document::BEGIN@10 at line 23 of Markdent/Parser.pm # once (40µs+17.4ms) by Markdent::Simple::Document::BEGIN@10 at line 44 of Markdent/Parser.pm # once (49µs+17.4ms) by Markdent::Simple::Document::BEGIN@10 at line 51 of Markdent/Parser.pm # once (40µs+17.2ms) by Markdent::Simple::Document::BEGIN@10 at line 38 of Markdent/Parser.pm # once (50µs+16.1ms) by Markdent::Simple::Document::BEGIN@9 at line 17 of Markdent/Handler/HTMLStream/Document.pm # once (43µs+15.0ms) by MooseX::Role::Parameterized::BEGIN@8 at line 32 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (41µs+14.6ms) by Markdent::Simple::Document::BEGIN@10 at line 57 of Markdent/Parser.pm # once (40µs+14.1ms) by MooseX::Role::Parameterized::BEGIN@8 at line 37 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (46µs+14.0ms) by Markdent::Simple::Document::BEGIN@10 at line 30 of Markdent/Parser.pm # once (42µs+13.9ms) by Markdent::Parser::BEGIN@11 at line 76 of Markdent/Dialect/Standard/SpanParser.pm # once (41µs+13.8ms) by Markdent::Parser::BEGIN@11 at line 84 of Markdent/Dialect/Standard/SpanParser.pm # once (40µs+12.0ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 27 of Markdent/Event/Image.pm # once (40µs+11.9ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 33 of Markdent/Event/Image.pm # once (39µs+11.8ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 27 of Markdent/Event/Text.pm # once (39µs+11.8ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 21 of Markdent/Event/StartLink.pm # once (38µs+11.8ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 21 of Markdent/Event/Text.pm # once (38µs+11.7ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 27 of Markdent/Event/StartLink.pm # once (42µs+10.1ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@24 at line 15 of Markdent/Event/StartHTMLTag.pm # once (40µs+9.16ms) by MooseX::Role::Parameterized::BEGIN@8 at line 14 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm # once (51µs+9.15ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@26 at line 15 of Markdent/Event/StartStrong.pm # once (42µs+8.85ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@15 at line 15 of Markdent/Event/EndHeader.pm # once (41µs+8.64ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@14 at line 15 of Markdent/Event/StartHeader.pm # once (41µs+8.52ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@18 at line 15 of Markdent/Event/HTMLComment.pm # once (42µs+8.50ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@23 at line 15 of Markdent/Event/StartEmphasis.pm # once (39µs+8.07ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 39 of Markdent/Event/Image.pm # once (47µs+7.99ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 15 of Markdent/Event/Image.pm # once (39µs+7.97ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 33 of Markdent/Event/StartLink.pm # once (39µs+7.94ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@24 at line 25 of Markdent/Event/StartHTMLTag.pm # once (41µs+7.92ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@27 at line 15 of Markdent/Event/Text.pm # once (41µs+7.92ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@20 at line 15 of Markdent/Event/HTMLTag.pm # once (38µs+7.91ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@20 at line 25 of Markdent/Event/HTMLTag.pm # once (41µs+7.90ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@14 at line 15 of Markdent/Event/EndEmphasis.pm # once (43µs+7.89ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@13 at line 15 of Markdent/Event/EndCode.pm # once (42µs+7.89ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@22 at line 15 of Markdent/Event/StartCode.pm # once (41µs+7.89ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@26 at line 15 of Markdent/Event/HTMLCommentBlock.pm # once (39µs+7.88ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@21 at line 21 of Markdent/Event/Image.pm # once (41µs+7.86ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@15 at line 15 of Markdent/Event/EndHTMLTag.pm # once (44µs+7.85ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@12 at line 15 of Markdent/Event/AutoLink.pm # once (47µs+7.84ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@25 at line 15 of Markdent/Event/StartLink.pm # once (40µs+7.83ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@25 at line 15 of Markdent/Event/HTMLBlock.pm # once (43µs+7.81ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@17 at line 15 of Markdent/Event/EndStrong.pm # once (41µs+7.78ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@19 at line 15 of Markdent/Event/HTMLEntity.pm # once (41µs+7.78ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@27 at line 15 of Markdent/Event/Preformatted.pm # once (38µs+5.12ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@8 at line 9 of MooseX/Role/Parameterized/Meta/Parameter.pm
sub has {
623504.57ms my $meta = shift;
63 my $name = shift;
64
65 Moose->throw_error('Usage: has \'name\' => ( key => value, ... )')
66 if @_ % 2 == 1;
67
68502.16ms my %options = ( definition_context => Moose::Util::_caller_info(), @_ );
# spent 2.16ms making 50 calls to Moose::Util::_caller_info, avg 43µs/call
69 my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
70502.58s $meta->add_attribute( $_, %options ) for @$attrs;
# spent 2.58s making 50 calls to Moose::Meta::Class::add_attribute, avg 51.5ms/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 3.30ms (73µs+3.23) within Moose::around which was called 2 times, avg 1.65ms/call: # once (49µs+1.65ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@8 at line 20 of MooseX/Role/Parameterized/Meta/Parameter.pm # once (24µs+1.57ms) by Moose::around at line 359 of Moose/Exporter.pm
sub around {
82127µs11.57ms Moose::Util::add_method_modifier(shift, 'around', \@_);
# spent 1.57ms making 1 call to Moose::Util::add_method_modifier
83}
84
8512µsour $SUPER_PACKAGE;
8612µsour $SUPER_BODY;
8712µ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
122135µs14.35msMoose::Exporter->setup_import_methods(
# spent 4.35ms 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 618ms (10.4+608) within Moose::init_meta which was called 45 times, avg 13.7ms/call: # 45 times (10.4ms+608ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 423 of Moose/Exporter.pm, avg 13.7ms/call
sub init_meta {
134 # This used to be called as a function. This hack preserves
135 # backwards compatibility.
1366307.03ms 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
15845552µs Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Class.")
# spent 552µs making 45 calls to UNIVERSAL::isa, avg 12µs/call
159 unless $metaclass->isa('Moose::Meta::Class');
160
161 # make a subtype for each Moose class
1629042.9ms class_type($class)
# spent 38.4ms making 45 calls to Moose::Util::TypeConstraints::class_type, avg 853µs/call # spent 4.52ms making 45 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 101µs/call
163 unless find_type_constraint($class);
164
165 my $meta;
166
1671352.55ms45541µ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
18045854µs my ( undef, @isa ) = @{ mro::get_linear_isa($class) };
# spent 854µs making 45 calls to mro::get_linear_isa, avg 19µ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
19945186ms $meta = $metaclass->initialize($class);
# spent 186ms making 45 calls to Moose::Meta::Class::initialize, avg 4.14ms/call
200 }
201
2021351.38ms if (defined $meta_name) {
203 # also check for inherited non moose 'meta' method?
204457.71ms my $existing = $meta->get_method($meta_name);
# spent 7.71ms making 45 calls to Class::MOP::Mixin::HasMethods::get_method, avg 171µ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 }
21445119ms $meta->_add_meta_method($meta_name);
# spent 119ms making 45 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.65ms/call
215 }
216
217 # make sure they inherit from Moose::Object
21890250ms $meta->superclasses($base_class)
# spent 250ms making 90 calls to Moose::Meta::Class::superclasses, avg 2.77ms/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
23122135µs$_->make_immutable(
# spent 135µ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.04ms44421ms ) for grep { $_->is_mutable }
# spent 408ms making 22 calls to Class::MOP::Class::make_immutable, avg 18.6ms/call # spent 12.2ms making 10 calls to Class::MOP::Object::meta, avg 1.22ms/call # spent 151µs making 2 calls to Moose::Meta::Role::Method::Required::meta, avg 76µs/call # spent 80µs making 1 call to Moose::Meta::Role::meta # spent 77µs making 1 call to Moose::Meta::TypeCoercion::Union::meta # spent 76µ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::Application::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 69µs making 1 call to Moose::Meta::Role::Application::ToInstance::meta # spent 69µs making 1 call to Moose::Meta::Role::Composite::meta # spent 68µs making 1 call to Moose::Meta::Role::Application::ToClass::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
268125µs246.8msMoose::Meta::Mixin::AttributeCore->meta->make_immutable(
# spent 46.7ms making 1 call to Class::MOP::Class::make_immutable # spent 78µs making 1 call to Class::MOP::Mixin::meta
269 inline_constructor => 0,
270 constructor_name => undef,
271);
272
273155µs1;
274
275__END__