← 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:04 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Overridden.pm
StatementsExecuted 449 statements in 6.52ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
36113.88ms23.9msMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
11182µs105µsMoose::Meta::Method::Overridden::::BEGIN@3Moose::Meta::Method::Overridden::BEGIN@3
11159µs13.1msMoose::Meta::Method::Overridden::::BEGIN@10Moose::Meta::Method::Overridden::BEGIN@10
11140µs108µsMoose::Meta::Method::Overridden::::BEGIN@4Moose::Meta::Method::Overridden::BEGIN@4
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
33139µs2128µs
# spent 105µs (82+23) within Moose::Meta::Method::Overridden::BEGIN@3 which was called: # once (82µs+23µs) by Moose::Meta::Class::BEGIN@19 at line 3
use strict;
# spent 105µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@3 # spent 23µs making 1 call to strict::import
43215µs2177µs
# spent 108µs (40+69) within Moose::Meta::Method::Overridden::BEGIN@4 which was called: # once (40µs+69µs) by Moose::Meta::Class::BEGIN@19 at line 4
use warnings;
# spent 108µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@4 # spent 69µs making 1 call to warnings::import
5
614µsour $VERSION = '1.19';
7153µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
103663µs226.2ms
# spent 13.1ms (59µs+13.1) within Moose::Meta::Method::Overridden::BEGIN@10 which was called: # once (59µs+13.1ms) by Moose::Meta::Class::BEGIN@19 at line 10
use base 'Moose::Meta::Method';
# spent 13.1ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@10 # spent 13.1ms making 1 call to base::import
11
12
# spent 23.9ms (3.88+20.0) within Moose::Meta::Method::Overridden::new which was called 36 times, avg 663µs/call: # 36 times (3.88ms+20.0ms) by Moose::Meta::Class::add_override_method_modifier at line 503 of Moose/Meta/Class.pm, avg 663µs/call
sub new {
133244.22ms 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
19 my $super_package = $args{package} || $args{class}->name;
20
21 my $name = $args{name};
22
233612.9ms my $super = $args{class}->find_next_method_by_name($name);
# spent 12.9ms making 36 calls to Class::MOP::Class::find_next_method_by_name, avg 358µs/call
24
25 (defined $super)
26 || $class->throw_error("You cannot override '$name' because it has no super method", data => $name);
27
2836218µs my $super_body = $super->body;
# spent 218µs making 36 calls to Class::MOP::Method::body, avg 6µs/call
29
30 my $method = $args{method};
31
32 my $body = sub {
331121.21ms local $Moose::SUPER_PACKAGE = $super_package;
34 local @Moose::SUPER_ARGS = @_;
35 local $Moose::SUPER_BODY = $super_body;
362812.6ms return $method->(@_);
37 };
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
43726.89ms $class->wrap(
# spent 6.69ms making 36 calls to Class::MOP::Method::wrap, avg 186µs/call # spent 198µs making 36 calls to Class::MOP::Package::name, avg 6µs/call
44 $body,
45 package_name => $args{class}->name,
46 name => $name
47 );
48}
49
50111µs1;
51
52__END__