← Index
NYTProf Performance Profile   « line view »
For fastest.pl
  Run on Fri Jan 31 20:48:16 2014
Reported on Fri Jan 31 20:49:40 2014

Filename/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Mouse.pm
StatementsExecuted 54 statements in 2.50ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1116.49ms9.94msMouse::::BEGIN@4 Mouse::BEGIN@4
1113.24ms3.33msMouse::::BEGIN@14 Mouse::BEGIN@14
1113.14ms3.69msMouse::::BEGIN@18 Mouse::BEGIN@18
1112.23ms4.07msMouse::::BEGIN@16 Mouse::BEGIN@16
111956µs1.03msMouse::::BEGIN@15 Mouse::BEGIN@15
111160µs226µsMouse::::BEGIN@17 Mouse::BEGIN@17
11137µs255µsMouse::::init_meta Mouse::init_meta
11120µs20µsMouse::::BEGIN@2 Mouse::BEGIN@2
11119µs324µsMouse::::has Mouse::has
11110µs10µsMouse::::BEGIN@13 Mouse::BEGIN@13
1117µs10µsFoo::Mouse::::metaFoo::Mouse::meta
1114µs4µsMouse::::BEGIN@8 Mouse::BEGIN@8
1114µs4µsMouse::::BEGIN@11 Mouse::BEGIN@11
1113µs3µsMouse::::BEGIN@9 Mouse::BEGIN@9
0000s0sMouse::::__ANON__[:137] Mouse::__ANON__[:137]
0000s0sMouse::::after Mouse::after
0000s0sMouse::::around Mouse::around
0000s0sMouse::::augment Mouse::augment
0000s0sMouse::::before Mouse::before
0000s0sMouse::::extends Mouse::extends
0000s0sMouse::::inner Mouse::inner
0000s0sMouse::::override Mouse::override
0000s0sMouse::::super Mouse::super
0000s0sMouse::::with Mouse::with
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Mouse;
2257µs120µs
# spent 20µs within Mouse::BEGIN@2 which was called: # once (20µs+0s) by Foo::Mouse::BEGIN@77 at line 2
use 5.006_002;
# spent 20µs making 1 call to Mouse::BEGIN@2
3
42138µs29.94ms
# spent 9.94ms (6.49+3.44) within Mouse::BEGIN@4 which was called: # once (6.49ms+3.44ms) by Foo::Mouse::BEGIN@77 at line 4
use Mouse::Exporter; # enables strict and warnings
# spent 9.94ms making 1 call to Mouse::BEGIN@4 # spent 6µs making 1 call to Mouse::Exporter::import
5
61800nsour $VERSION = '2.1.0';
7
8225µs14µs
# spent 4µs within Mouse::BEGIN@8 which was called: # once (4µs+0s) by Foo::Mouse::BEGIN@77 at line 8
use Carp ();
# spent 4µs making 1 call to Mouse::BEGIN@8
9225µs13µs
# spent 3µs within Mouse::BEGIN@9 which was called: # once (3µs+0s) by Foo::Mouse::BEGIN@77 at line 9
use Scalar::Util ();
# spent 3µs making 1 call to Mouse::BEGIN@9
10
11227µs14µs
# spent 4µs within Mouse::BEGIN@11 which was called: # once (4µs+0s) by Foo::Mouse::BEGIN@77 at line 11
use Mouse::Util ();
# spent 4µs making 1 call to Mouse::BEGIN@11
12
13236µs110µs
# spent 10µs within Mouse::BEGIN@13 which was called: # once (10µs+0s) by Foo::Mouse::BEGIN@77 at line 13
use Mouse::Meta::Module;
# spent 10µs making 1 call to Mouse::BEGIN@13
142132µs13.33ms
# spent 3.33ms (3.24+98µs) within Mouse::BEGIN@14 which was called: # once (3.24ms+98µs) by Foo::Mouse::BEGIN@77 at line 14
use Mouse::Meta::Class;
# spent 3.33ms making 1 call to Mouse::BEGIN@14
152119µs11.03ms
# spent 1.03ms (956µs+70µs) within Mouse::BEGIN@15 which was called: # once (956µs+70µs) by Foo::Mouse::BEGIN@77 at line 15
use Mouse::Meta::Role;
# spent 1.03ms making 1 call to Mouse::BEGIN@15
162127µs14.07ms
# spent 4.07ms (2.23+1.85) within Mouse::BEGIN@16 which was called: # once (2.23ms+1.85ms) by Foo::Mouse::BEGIN@77 at line 16
use Mouse::Meta::Attribute;
# spent 4.07ms making 1 call to Mouse::BEGIN@16
172123µs1226µs
# spent 226µs (160+66) within Mouse::BEGIN@17 which was called: # once (160µs+66µs) by Foo::Mouse::BEGIN@77 at line 17
use Mouse::Object;
# spent 226µs making 1 call to Mouse::BEGIN@17
182910µs13.69ms
# spent 3.69ms (3.14+551µs) within Mouse::BEGIN@18 which was called: # once (3.14ms+551µs) by Foo::Mouse::BEGIN@77 at line 18
use Mouse::Util::TypeConstraints ();
# spent 3.69ms making 1 call to Mouse::BEGIN@18
19
2016µs1113µsMouse::Exporter->setup_import_methods(
# spent 113µs making 1 call to Mouse::Exporter::setup_import_methods
21 as_is => [qw(
22 extends with
23 has
24 before after around
25 override super
26 augment inner
27 ),
28 \&Scalar::Util::blessed,
29 \&Carp::confess,
30 ],
31);
32
33
34sub extends {
35 Mouse::Meta::Class->initialize(scalar caller)->superclasses(@_);
36 return;
37}
38
39sub with {
40 Mouse::Util::apply_all_roles(scalar(caller), @_);
41 return;
42}
43
44
# spent 324µs (19+305) within Mouse::has which was called: # once (19µs+305µs) by main::RUNTIME at line 78 of fastest.pl
sub has {
4515µs15µs my $meta = Mouse::Meta::Class->initialize(scalar caller);
# spent 5µs making 1 call to Mouse::Meta::Module::initialize
461700ns my $name = shift;
47
4811µs $meta->throw_error(q{Usage: has 'name' => ( key => value, ... )})
49 if @_ % 2; # odd number of arguments
50
5111µs for my $n(ref($name) ? @{$name} : $name){
5213µs1300µs $meta->add_attribute($n => @_);
# spent 300µs making 1 call to Mouse::Meta::Class::add_attribute
53 }
5414µs return;
55}
56
57sub before {
58 my $meta = Mouse::Meta::Class->initialize(scalar caller);
59 my $code = pop;
60 for my $name($meta->_collect_methods(@_)) {
61 $meta->add_before_method_modifier($name => $code);
62 }
63 return;
6412µs}
651400ns
661684µs1672µssub after {
# spent 672µs making 1 call to XSLoader::load
6714µs156µs my $meta = Mouse::Meta::Class->initialize(scalar caller);
# spent 56µs making 1 call to Mouse::Exporter::do_import
6813µs134µs my $code = pop;
# spent 34µs making 1 call to Mouse::Exporter::do_import
6913µs147µs for my $name($meta->_collect_methods(@_)) {
# spent 47µs making 1 call to Mouse::Exporter::do_import
70111µs $meta->add_after_method_modifier($name => $code);
71 }
72 return;
73}
74
75sub around {
76 my $meta = Mouse::Meta::Class->initialize(scalar caller);
77 my $code = pop;
78 for my $name($meta->_collect_methods(@_)) {
79 $meta->add_around_method_modifier($name => $code);
80 }
81 return;
82}
83
841100nsour $SUPER_PACKAGE;
8510sour $SUPER_BODY;
861200nsour @SUPER_ARGS;
87
88sub super {
89 # This check avoids a recursion loop - see
90 # t/100_bugs/020_super_recursion.t
91 return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller();
92 return if !defined $SUPER_BODY;
93 $SUPER_BODY->(@SUPER_ARGS);
94}
95
96sub override {
97 # my($name, $method) = @_;
98 Mouse::Meta::Class->initialize(scalar caller)->add_override_method_modifier(@_);
99}
100
1011100nsour %INNER_BODY;
1021100nsour %INNER_ARGS;
103
104sub inner {
105 my $pkg = caller();
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 }
112 else {
113 return;
114 }
115}
116
117sub augment {
118 #my($name, $method) = @_;
119 Mouse::Meta::Class->initialize(scalar caller)->add_augment_method_modifier(@_);
120 return;
121}
122
123
# spent 255µs (37+218) within Mouse::init_meta which was called: # once (37µs+218µs) by Mouse::Exporter::do_import at line 182 of Mouse/Exporter.pm
sub init_meta {
1241200ns shift;
12511µs my %args = @_;
126
1271400ns my $class = $args{for_class}
128 or confess("Cannot call init_meta without specifying a for_class");
129
1301400ns my $base_class = $args{base_class} || 'Mouse::Object';
1311300ns my $metaclass = $args{metaclass} || 'Mouse::Meta::Class';
132
13314µs121µs my $meta = $metaclass->initialize($class);
# spent 21µs making 1 call to Mouse::Meta::Module::initialize
134
135
# spent 10µs (7+3) within Foo::Mouse::meta which was called: # once (7µs+3µs) by main::RUNTIME at line 79 of fastest.pl
$meta->add_method(meta => sub{
13615µs13µs return $metaclass->initialize(ref($_[0]) || $_[0]);
# spent 3µs making 1 call to Mouse::Meta::Module::initialize
137122µs110µs });
# spent 10µs making 1 call to Mouse::Meta::Module::add_method
138
13913µs274µs $meta->superclasses($base_class)
# spent 74µs making 2 calls to Mouse::Meta::Class::superclasses, avg 37µs/call
140 unless $meta->superclasses;
141
142 # make a class type for each Mouse class
14313µs2112µs Mouse::Util::TypeConstraints::class_type($class)
# spent 97µs making 1 call to Mouse::Util::TypeConstraints::class_type # spent 15µs making 1 call to Mouse::Util::TypeConstraints::find_type_constraint
144 unless Mouse::Util::TypeConstraints::find_type_constraint($class);
145
14614µs return $meta;
147}
148
14919µs1;
150__END__