← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/bin/epoll_server.pl
  Run on Wed Jan 5 05:34:33 2011
Reported on Wed Jan 5 05:42:30 2011

File /usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/MooseX/Role/WithOverloading/Meta/Role/Application.pm
Statements Executed 898
Statement Execution Time 14.4ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41110.6ms54.0msMooseX::Role::WithOverloading::Meta::Role::Application::::apply_overloadingMooseX::Role::WithOverloading::Meta::Role::Application::apply_overloading
1111.05ms102msMooseX::Role::WithOverloading::Meta::Role::Application::::BEGIN@7MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@7
411546µs546µsMooseX::Role::WithOverloading::Meta::Role::Application::::_build_overload_opsMooseX::Role::WithOverloading::Meta::Role::Application::_build_overload_ops
111138µs4.32msMooseX::Role::WithOverloading::Meta::Role::Application::::BEGIN@5MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@5
11136µs171µsMooseX::Role::WithOverloading::Meta::Role::Application::::BEGIN@8MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@8
11120µs20µsMooseX::Role::WithOverloading::Meta::Role::Application::::BEGIN@6MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@6
0000s0sMooseX::Role::WithOverloading::Meta::Role::Application::::__ANON__[:27]MooseX::Role::WithOverloading::Meta::Role::Application::__ANON__[:27]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package MooseX::Role::WithOverloading::Meta::Role::Application;
213µsour $VERSION = '0.05';
3# ABSTRACT: Role application role for Roles which support overloading
4
53101µs28.50ms
# spent 4.32ms (138µs+4.18) within MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@5 which was called # once (138µs+4.18ms) by Class::MOP::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Class/MOP.pm:103] at line 5
use Moose::Role;
63150µs120µs
# spent 20µs within MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@6 which was called # once (20µs+0s) by Class::MOP::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Class/MOP.pm:103] at line 6
use overload ();
73761µs2119ms
# spent 102ms (1.05+101) within MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@7 which was called # once (1.05ms+101ms) by Class::MOP::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Class/MOP.pm:103] at line 7
use MooseX::Types::Moose qw/ArrayRef Str/;
# spent 102ms making 1 call to MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@7 # spent 17.0ms making 1 call to MooseX::Types::Base::import
831.30ms2306µs
# spent 171µs (36+135) within MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@8 which was called # once (36µs+135µs) by Class::MOP::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Class/MOP.pm:103] at line 8
use namespace::autoclean;
# spent 171µs making 1 call to MooseX::Role::WithOverloading::Meta::Role::Application::BEGIN@8 # spent 135µs making 1 call to namespace::autoclean::import
9
10163µs1622µsrequires 'apply_methods';
# spent 622µs making 1 call to Moose::Role::requires
11
12
13120µs37.07mshas overload_ops => (
# spent 5.72ms making 1 call to __TYPE__::ArrayRef # spent 854µs making 1 call to Moose::Role::has # spent 490µs making 1 call to __TYPE__::Str
14 is => 'ro',
15 isa => ArrayRef[Str],
16 builder => '_build_overload_ops',
17);
18
19
# spent 546µs within MooseX::Role::WithOverloading::Meta::Role::Application::_build_overload_ops which was called 4 times, avg 137µs/call: # 4 times (546µs+0s) by Moose::Meta::Attribute::_call_builder at line 412 of Moose/Meta/Attribute.pm, avg 137µs/call
sub _build_overload_ops {
2060568µs return [map { split /\s+/ } values %overload::ops];
21}
22
23
24after apply_methods => sub {
25414µs my ($self, $role, $other) = @_;
26481µs454.0ms $self->apply_overloading($role, $other);
# spent 54.0ms making 4 calls to MooseX::Role::WithOverloading::Meta::Role::Application::apply_overloading, avg 13.5ms/call
2718µs1108µs};
# spent 108µs making 1 call to Moose::Role::after
28
29
30
# spent 54.0ms (10.6+43.4) within MooseX::Role::WithOverloading::Meta::Role::Application::apply_overloading which was called 4 times, avg 13.5ms/call: # 4 times (10.6ms+43.4ms) by Class::MOP::Class:::after at line 26, avg 13.5ms/call
sub apply_overloading {
31411µs my ($self, $role, $other) = @_;
324178µs8202µs return unless overload::Overloaded($role->name);
# spent 104µs making 4 calls to overload::Overloaded, avg 26µs/call # spent 98µs making 4 calls to Class::MOP::Package::name, avg 25µs/call
33
34 # overloading predicate method
354104µs8650µs $other->add_package_symbol('&()' => $role->get_package_symbol('&()'));
# spent 390µs making 4 calls to Class::MOP::Package::get_package_symbol, avg 98µs/call # spent 260µs making 4 calls to Class::MOP::Package::add_package_symbol, avg 65µs/call
36 # fallback value
374152µs121.03ms $other->add_package_symbol('$()' => $role->get_package_symbol('$()'))
# spent 420µs making 4 calls to Class::MOP::Package::get_package_symbol, avg 105µs/call # spent 346µs making 4 calls to Class::MOP::Package::has_package_symbol, avg 87µs/call # spent 267µs making 4 calls to Class::MOP::Package::add_package_symbol, avg 67µs/call
38 if $role->has_package_symbol('$()');
39 # register with magic by touching
40453µs4637µs $other->get_package_symbol('%OVERLOAD')->{dummy}++;
# spent 637µs making 4 calls to Class::MOP::Package::get_package_symbol, avg 159µs/call
41
4241.50ms4198µs for my $op (@{ $self->overload_ops }) {
# spent 169µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::2::overload_ops # spent 29µs making 3 calls to Class::MOP::Class::__ANON__::SERIAL::3::overload_ops, avg 10µs/call
43264767µs my $code_sym = '&(' . $op;
44
452646.47ms52823.6ms next if overload::Method($other->name, $op);
# spent 21.2ms making 264 calls to overload::Method, avg 80µs/call # spent 2.37ms making 264 calls to Class::MOP::Package::name, avg 9µs/call
462602.03ms26017.1ms next unless $role->has_package_symbol($code_sym);
# spent 17.1ms making 260 calls to Class::MOP::Package::has_package_symbol, avg 66µs/call
47
48 my $meth = $role->get_package_symbol($code_sym);
49 next unless $meth;
50
51 # when using "use overload $op => sub { };" this is the actual method
52 # to be called on overloading. otherwise it's \&overload::nil. see
53 # below.
54 $other->add_package_symbol($code_sym => $meth);
55
56 # when using "use overload $op => 'method_name';" overload::nil is
57 # installed into the code slot of the glob and the actual method called
58 # is determined by the scalar slot of the same glob.
59 if ($meth == \&overload::nil) {
60 my $scalar_sym = qq{\$($op};
61 $other->add_package_symbol(
62 $scalar_sym => ${ $role->get_package_symbol($scalar_sym) },
63 );
64 }
65 }
66}
67
68144µs1;
69
70154µs110.7ms__END__
71
72=pod
73
74=head1 NAME
75
76MooseX::Role::WithOverloading::Meta::Role::Application - Role application role for Roles which support overloading
77
78=head1 VERSION
79
80version 0.05
81
82=head1 METHODS
83
84=head2 overload_ops
85
86Returns an arrayref of the names of overloaded operations
87
88
89
90=head2 apply_methods ($role, $other)
91
92Wrapped with an after modifier which calls the C<< ->apply_overloading >>
93method.
94
95
96
97=head2 apply_overloading ($role, $other)
98
99Does the heavy lifting of applying overload operations to
100a class or role which the role is applied to.
101
102
103
104=head1 AUTHORS
105
106 Florian Ragwitz <rafl@debian.org>
107 Tomas Doran <bobtfish@bobtfish.net>
108
109=head1 COPYRIGHT AND LICENSE
110
111This software is copyright (c) 2010 by Florian Ragwitz.
112
113This is free software; you can redistribute it and/or modify it under
114the same terms as the Perl 5 programming language system itself.
115
116=cut
117
118