← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:05:24 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Overridden.pm
StatementsExecuted 188 statements in 3.33ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
15111.74ms11.3msMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
11167µs86µsMoose::Meta::Method::Overridden::::BEGIN@3Moose::Meta::Method::Overridden::BEGIN@3
11150µs119µsMoose::Meta::Method::Overridden::::BEGIN@4Moose::Meta::Method::Overridden::BEGIN@4
11139µs12.9msMoose::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
3397µs2104µs
# spent 86µs (67+19) within Moose::Meta::Method::Overridden::BEGIN@3 which was called: # once (67µs+19µs) by Moose::Meta::Class::BEGIN@19 at line 3
use strict;
# spent 86µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@3 # spent 19µs making 1 call to strict::import
43202µs2188µs
# spent 119µs (50+69) within Moose::Meta::Method::Overridden::BEGIN@4 which was called: # once (50µs+69µs) by Moose::Meta::Class::BEGIN@19 at line 4
use warnings;
# spent 119µ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';
7164µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
103634µs225.8ms
# spent 12.9ms (39µs+12.9) within Moose::Meta::Method::Overridden::BEGIN@10 which was called: # once (39µs+12.9ms) by Moose::Meta::Class::BEGIN@19 at line 10
use base 'Moose::Meta::Method';
# spent 12.9ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@10 # spent 12.9ms making 1 call to base::import
11
12
# spent 11.3ms (1.74+9.60) within Moose::Meta::Method::Overridden::new which was called 15 times, avg 756µs/call: # 15 times (1.74ms+9.60ms) by Moose::Meta::Class::add_override_method_modifier at line 503 of Moose/Meta/Class.pm, avg 756µs/call
sub new {
131351.91ms 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
23156.05ms my $super = $args{class}->find_next_method_by_name($name);
# spent 6.05ms making 15 calls to Class::MOP::Class::find_next_method_by_name, avg 404µs/call
24
25 (defined $super)
26 || $class->throw_error("You cannot override '$name' because it has no super method", data => $name);
27
2815104µs my $super_body = $super->body;
# spent 104µs making 15 calls to Class::MOP::Method::body, avg 7µs/call
29
30 my $method = $args{method};
31
32 my $body = sub {
3340412µs local $Moose::SUPER_PACKAGE = $super_package;
34 local @Moose::SUPER_ARGS = @_;
35 local $Moose::SUPER_BODY = $super_body;
36103.86ms 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
43303.45ms $class->wrap(
# spent 3.36ms making 15 calls to Class::MOP::Method::wrap, avg 224µs/call # spent 89µs making 15 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__