← 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:13:40 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Overridden.pm
StatementsExecuted 530 statements in 7.57ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
45114.81ms36.5msMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
11175µs94µsMoose::Meta::Method::Overridden::::BEGIN@3Moose::Meta::Method::Overridden::BEGIN@3
11138µs106µsMoose::Meta::Method::Overridden::::BEGIN@4Moose::Meta::Method::Overridden::BEGIN@4
11138µs14.5msMoose::Meta::Method::Overridden::::BEGIN@10Moose::Meta::Method::Overridden::BEGIN@10
0000s0sMoose::Meta::Method::Overridden::::__ANON__[:37]Moose::Meta::Method::Overridden::__ANON__[:37]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Meta::Method::Overridden;
2
33130µs2112µs
# spent 94µs (75+19) within Moose::Meta::Method::Overridden::BEGIN@3 which was called: # once (75µs+19µs) by Moose::Meta::Class::BEGIN@19 at line 3
use strict;
# spent 94µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@3 # spent 19µs making 1 call to strict::import
43225µs2173µs
# spent 106µs (38+68) within Moose::Meta::Method::Overridden::BEGIN@4 which was called: # once (38µs+68µs) by Moose::Meta::Class::BEGIN@19 at line 4
use warnings;
# spent 106µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@4 # spent 68µs making 1 call to warnings::import
5
614µsour $VERSION = '1.19';
7170µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
103655µs228.9ms
# spent 14.5ms (38µs+14.4) within Moose::Meta::Method::Overridden::BEGIN@10 which was called: # once (38µs+14.4ms) by Moose::Meta::Class::BEGIN@19 at line 10
use base 'Moose::Meta::Method';
# spent 14.5ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@10 # spent 14.4ms making 1 call to base::import
11
12
# spent 36.5ms (4.81+31.7) within Moose::Meta::Method::Overridden::new which was called 45 times, avg 812µs/call: # 45 times (4.81ms+31.7ms) by Moose::Meta::Class::add_override_method_modifier at line 319 of Moose/Meta/Class.pm, avg 812µs/call
sub new {
1345517µs my ( $class, %args ) = @_;
14
15 # the package can be overridden by roles
16 # it is really more like body's compilation stash
17 # this is where we need to override the definition of super() so that the
18 # body of the code can call the right overridden version
1945204µs my $super_package = $args{package} || $args{class}->name;
20
2145173µs my $name = $args{name};
22
2345629µs4523.7ms my $super = $args{class}->find_next_method_by_name($name);
# spent 23.7ms making 45 calls to Class::MOP::Class::find_next_method_by_name, avg 526µs/call
24
2545101µs (defined $super)
26 || $class->throw_error("You cannot override '$name' because it has no super method", data => $name);
27
2845814µs45268µs my $super_body = $super->body;
# spent 268µs making 45 calls to Class::MOP::Method::body, avg 6µs/call
29
3045154µs my $method = $args{method};
31
32 my $body = sub {
3328125µs local $Moose::SUPER_PACKAGE = $super_package;
3428207µs local @Moose::SUPER_ARGS = @_;
352878µs local $Moose::SUPER_BODY = $super_body;
3628797µs2814.7ms return $method->(@_);
3745654µs };
38
39 # FIXME do we need this make sure this works for next::method?
40 # subname "${super_package}::${name}", $method;
41
42 # FIXME store additional attrs
43452.02ms907.79ms $class->wrap(
# spent 7.54ms making 45 calls to Class::MOP::Method::wrap, avg 168µs/call # spent 249µs making 45 calls to Class::MOP::Package::name, avg 6µs/call
44 $body,
45 package_name => $args{class}->name,
46 name => $name
47 );
48}
49
50110µs1;
51
52__END__