← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/hailo
  Run on Thu Oct 21 22:50:37 2010
Reported on Thu Oct 21 22:52:12 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Mouse/Role.pm
StatementsExecuted 241 statements in 1.58ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1011326µs1.87msMouse::Role::::init_meta Mouse::Role::init_meta
14147289µs492µsMouse::Role::::has Mouse::Role::has
11113148µs611µsMouse::Role::::requires Mouse::Role::requires
33275µs149µsMouse::Role::::around Mouse::Role::around
33328µs51.3msMouse::Role::::with Mouse::Role::with (recurses: max depth 1, inclusive time 11.4ms)
11125µs35µsMouse::Role::::BEGIN@2 Mouse::Role::BEGIN@2
11111µs53µsMouse::Role::::BEGIN@7 Mouse::Role::BEGIN@7
11110µs54µsMouse::Role::::BEGIN@6 Mouse::Role::BEGIN@6
1119µs14µsMouseX::Getopt::GLD::::meta MouseX::Getopt::GLD::meta
1115µs5µsMouse::Role::::BEGIN@9 Mouse::Role::BEGIN@9
0000s0sHailo::Role::Arguments::::meta Hailo::Role::Arguments::meta
0000s0sHailo::Role::Engine::::meta Hailo::Role::Engine::meta
0000s0sHailo::Role::Storage::::meta Hailo::Role::Storage::meta
0000s0sHailo::Role::Tokenizer::::meta Hailo::Role::Tokenizer::meta
0000s0sMouse::Role::::__ANON__[:121] Mouse::Role::__ANON__[:121]
0000s0sMouse::Role::::after Mouse::Role::after
0000s0sMouse::Role::::augment Mouse::Role::augment
0000s0sMouse::Role::::before Mouse::Role::before
0000s0sMouse::Role::::excludes Mouse::Role::excludes
0000s0sMouse::Role::::extends Mouse::Role::extends
0000s0sMouse::Role::::inner Mouse::Role::inner
0000s0sMouse::Role::::override Mouse::Role::override
0000s0sMouse::Role::::super Mouse::Role::super
0000s0sMouseX::Getopt::Basic::::meta MouseX::Getopt::Basic::meta
0000s0sMouseX::Getopt::Dashes::::meta MouseX::Getopt::Dashes::meta
0000s0sMouseX::Getopt::Meta::Attribute::Trait::NoGetopt::::metaMouseX::Getopt::Meta::Attribute::Trait::NoGetopt::meta
0000s0sMouseX::Getopt::Meta::Attribute::Trait::::meta MouseX::Getopt::Meta::Attribute::Trait::meta
0000s0sMouseX::Getopt::::meta MouseX::Getopt::meta
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Mouse::Role;
2237µs245µs
# spent 35µs (25+10) within Mouse::Role::BEGIN@2 which was called: # once (25µs+10µs) by MouseX::Getopt::BEGIN@10 at line 2
use Mouse::Exporter; # enables strict and warnings
# spent 35µs making 1 call to Mouse::Role::BEGIN@2 # spent 10µs making 1 call to Mouse::Exporter::import
3
412µsour $VERSION = '0.80';
5
6238µs299µs
# spent 54µs (10+44) within Mouse::Role::BEGIN@6 which was called: # once (10µs+44µs) by MouseX::Getopt::BEGIN@10 at line 6
use Carp qw(confess);
# spent 54µs making 1 call to Mouse::Role::BEGIN@6 # spent 44µs making 1 call to Exporter::import
7225µs295µs
# spent 53µs (11+42) within Mouse::Role::BEGIN@7 which was called: # once (11µs+42µs) by MouseX::Getopt::BEGIN@10 at line 7
use Scalar::Util qw(blessed);
# spent 53µs making 1 call to Mouse::Role::BEGIN@7 # spent 42µs making 1 call to Exporter::import
8
92512µs15µs
# spent 5µs within Mouse::Role::BEGIN@9 which was called: # once (5µs+0s) by MouseX::Getopt::BEGIN@10 at line 9
use Mouse ();
# spent 5µs making 1 call to Mouse::Role::BEGIN@9
10
1117µs1244µsMouse::Exporter->setup_import_methods(
# spent 244µs making 1 call to Mouse::Exporter::setup_import_methods
12 as_is => [qw(
13 extends with
14 has
15 before after around
16 override super
17 augment inner
18
19 requires excludes
20 ),
21 \&Scalar::Util::blessed,
22 \&Carp::confess,
23 ],
24);
25
26
27sub extends {
28 Carp::croak "Roles do not support 'extends'";
29}
30
31
# spent 51.3ms (28µs+51.3) within Mouse::Role::with which was called 3 times, avg 17.1ms/call: # once (8µs+49.7ms) by Any::Moose::_install_module at line 12 of MouseX/Getopt.pm # once (9µs+1.58ms) by Mouse::Util::_try_load_one_class at line 12 of MouseX/Getopt/Dashes.pm # once (11µs+-11µs) by Mouse::Util::_try_load_one_class at line 14 of MouseX/Getopt/GLD.pm
sub with {
32317µs349.7ms Mouse::Util::apply_all_roles(scalar(caller), @_);
# spent 62.7ms making 3 calls to Mouse::Util::apply_all_roles, avg 20.9ms/call, recursion: max depth 1, sum of overlapping time 13.0ms
33314µs return;
34}
35
36
# spent 492µs (289+203) within Mouse::Role::has which was called 14 times, avg 35µs/call: # once (26µs+18µs) by Mouse::Util::_try_load_one_class at line 7 of lib/Hailo/Role/Arguments.pm # once (25µs+17µs) by Mouse::Util::_try_load_one_class at line 13 of MouseX/Getopt/Meta/Attribute/Trait.pm # once (25µs+17µs) by Mouse::Util::_try_load_one_class at line 7 of lib/Hailo/Role/Engine.pm # once (24µs+16µs) by Mouse::Util::_try_load_one_class at line 16 of lib/Hailo/Role/Tokenizer.pm # once (22µs+16µs) by Mouse::Util::_try_load_one_class at line 19 of MouseX/Getopt/Basic.pm # once (20µs+15µs) by Mouse::Util::_try_load_one_class at line 7 of lib/Hailo/Role/Storage.pm # once (20µs+15µs) by Mouse::Util::_try_load_one_class at line 22 of MouseX/Getopt/GLD.pm # once (19µs+13µs) by Mouse::Util::_try_load_one_class at line 27 of MouseX/Getopt/Meta/Attribute/Trait.pm # once (19µs+13µs) by Mouse::Util::_try_load_one_class at line 16 of MouseX/Getopt/GLD.pm # once (18µs+13µs) by Mouse::Util::_try_load_one_class at line 20 of MouseX/Getopt/Basic.pm # once (18µs+13µs) by Mouse::Util::_try_load_one_class at line 13 of lib/Hailo/Role/Engine.pm # once (17µs+13µs) by Mouse::Util::_try_load_one_class at line 23 of lib/Hailo/Role/Storage.pm # once (18µs+12µs) by Mouse::Util::_try_load_one_class at line 17 of lib/Hailo/Role/Storage.pm # once (17µs+13µs) by Mouse::Util::_try_load_one_class at line 12 of lib/Hailo/Role/Storage.pm
sub has {
371460µs1481µs my $meta = Mouse::Meta::Role->initialize(scalar caller);
# spent 81µs making 14 calls to Mouse::Meta::Module::initialize, avg 6µs/call
381417µs my $name = shift;
39
401419µs $meta->throw_error(q{Usage: has 'name' => ( key => value, ... )})
41 if @_ % 2; # odd number of arguments
42
431436µs for my $n(ref($name) ? @{$name} : $name){
441481µs14122µs $meta->add_attribute($n => @_);
# spent 122µs making 14 calls to Mouse::Meta::Role::add_attribute, avg 9µs/call
45 }
461460µs return;
47}
48
49sub before {
50 my $meta = Mouse::Meta::Role->initialize(scalar caller);
51 my $code = pop;
52 for my $name($meta->_collect_methods(@_)) {
53 $meta->add_before_method_modifier($name => $code);
54 }
55 return;
56}
57
58sub after {
59 my $meta = Mouse::Meta::Role->initialize(scalar caller);
60 my $code = pop;
61 for my $name($meta->_collect_methods(@_)) {
62 $meta->add_after_method_modifier($name => $code);
63 }
64 return;
65}
66
67
# spent 149µs (75+74) within Mouse::Role::around which was called 3 times, avg 50µs/call: # once (31µs+27µs) by Mouse::Util::_try_load_one_class at line 33 of MouseX/Getopt/GLD.pm # once (24µs+24µs) by Mouse::Util::_try_load_one_class at line 24 of MouseX/Getopt/Dashes.pm # once (20µs+22µs) by Mouse::Util::_try_load_one_class at line 39 of MouseX/Getopt/GLD.pm
sub around {
68314µs317µs my $meta = Mouse::Meta::Role->initialize(scalar caller);
# spent 17µs making 3 calls to Mouse::Meta::Module::initialize, avg 6µs/call
6934µs my $code = pop;
70321µs342µs for my $name($meta->_collect_methods(@_)) {
# spent 42µs making 3 calls to Mouse::Meta::Module::_collect_methods, avg 14µs/call
71333µs314µs $meta->add_around_method_modifier($name => $code);
# spent 14µs making 3 calls to Mouse::Meta::Role::add_around_method_modifier, avg 5µs/call
72 }
73312µs return;
74}
75
76
77sub super {
78 return if !defined $Mouse::SUPER_BODY;
79 $Mouse::SUPER_BODY->(@Mouse::SUPER_ARGS);
80}
81
82sub override {
83 # my($name, $code) = @_;
84 Mouse::Meta::Role->initialize(scalar caller)->add_override_method_modifier(@_);
85 return;
86}
87
88# We keep the same errors messages as Moose::Role emits, here.
89sub inner {
90 Carp::croak "Roles cannot support 'inner'";
91}
92
93sub augment {
94 Carp::croak "Roles cannot support 'augment'";
95}
96
97
# spent 611µs (148+463) within Mouse::Role::requires which was called 11 times, avg 56µs/call: # once (16µs+51µs) by Mouse::Util::_try_load_one_class at line 28 of lib/Hailo/Role/Storage.pm # once (15µs+50µs) by Mouse::Util::_try_load_one_class at line 20 of lib/Hailo/Role/Engine.pm # once (16µs+48µs) by Mouse::Util::_try_load_one_class at line 34 of lib/Hailo/Role/Tokenizer.pm # once (12µs+43µs) by Mouse::Util::_try_load_one_class at line 30 of lib/Hailo/Role/Storage.pm # once (13µs+40µs) by Mouse::Util::_try_load_one_class at line 34 of lib/Hailo/Role/Storage.pm # once (13µs+39µs) by Mouse::Util::_try_load_one_class at line 29 of lib/Hailo/Role/Storage.pm # once (12µs+39µs) by Mouse::Util::_try_load_one_class at line 31 of lib/Hailo/Role/Storage.pm # once (12µs+39µs) by Mouse::Util::_try_load_one_class at line 33 of lib/Hailo/Role/Storage.pm # once (13µs+38µs) by Mouse::Util::_try_load_one_class at line 32 of lib/Hailo/Role/Storage.pm # once (13µs+38µs) by Mouse::Util::_try_load_one_class at line 21 of lib/Hailo/Role/Engine.pm # once (12µs+38µs) by Mouse::Util::_try_load_one_class at line 35 of lib/Hailo/Role/Tokenizer.pm
sub requires {
981145µs1159µs my $meta = Mouse::Meta::Role->initialize(scalar caller);
# spent 59µs making 11 calls to Mouse::Meta::Module::initialize, avg 5µs/call
991113µs $meta->throw_error("Must specify at least one method") unless @_;
1001142µs11404µs $meta->add_required_methods(@_);
# spent 404µs making 11 calls to Mouse::Meta::Role::add_required_methods, avg 37µs/call
1011142µs return;
102}
103
104sub excludes {
105 Mouse::Util::not_supported();
106}
107
108
# spent 1.87ms (326µs+1.55) within Mouse::Role::init_meta which was called 10 times, avg 187µs/call: # 10 times (326µs+1.55ms) by Mouse::Exporter::do_import at line 181 of Mouse/Exporter.pm, avg 187µs/call
sub init_meta{
1091011µs shift;
1101026µs my %args = @_;
111
1121016µs my $class = $args{for_class}
113 or Carp::confess("Cannot call init_meta without specifying a for_class");
114
1151016µs my $metaclass = $args{metaclass} || 'Mouse::Meta::Role';
116
1171053µs10325µs my $meta = $metaclass->initialize($class);
# spent 325µs making 10 calls to Mouse::Meta::Module::initialize, avg 32µs/call
118
119
# spent 14µs (9+6) within MouseX::Getopt::GLD::meta which was called: # once (9µs+6µs) by hailo::BEGIN@8 at line 18 of lib/Hailo/Command.pm
$meta->add_method(meta => sub{
12018µs16µs $metaclass->initialize(ref($_[0]) || $_[0]);
# spent 6µs making 1 call to Mouse::Meta::Module::initialize
12110164µs1092µs });
# spent 92µs making 10 calls to Mouse::Meta::Module::add_method, avg 9µs/call
122
123 # make a role type for each Mouse role
1241086µs201.13ms Mouse::Util::TypeConstraints::role_type($class)
# spent 954µs making 7 calls to Mouse::Util::TypeConstraints::role_type, avg 136µs/call # spent 169µs making 10 calls to Mouse::Util::TypeConstraints::find_type_constraint, avg 17µs/call # spent 6µs making 3 calls to Mouse::Meta::TypeConstraint::_identity, avg 2µs/call
125 unless Mouse::Util::TypeConstraints::find_type_constraint($class);
126
1271039µs return $meta;
128}
129
13016µs1;
131
132__END__