Profile of Moose/Meta/Method/Overridden.pm

← Index
NYTProf Performance Profile «line view»
For script/ponapi
Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename | /usr/local/lib/perl/5.18.2/Moose/Meta/Method/Overridden.pm
Statements | Executed 635 statements in 1.29ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
25 | 1 | 1 | 378µs | 2.43ms | Moose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
1 | 1 | 1 | 18µs | 21µs | Moose::Meta::Method::Overridden::::BEGIN@5Moose::Meta::Method::Overridden::BEGIN@5
1 | 1 | 1 | 9µs | 18µs | Moose::Meta::Method::Overridden::::BEGIN@4Moose::Meta::Method::Overridden::BEGIN@4
1 | 1 | 1 | 8µs | 168µs | Moose::Meta::Method::Overridden::::BEGIN@9Moose::Meta::Method::Overridden::BEGIN@9
1 | 1 | 1 | 8µs | 6.07ms | Moose::Meta::Method::Overridden::::BEGIN@7Moose::Meta::Method::Overridden::BEGIN@7
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Overridden::::__ANON__[:39]Moose::Meta::Method::Overridden::__ANON__[:39]

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Moose::Meta::Method::Overridden;
2 | 1 | 400ns |  |  | our $VERSION = '2.1604';
3 |  |  |  |  |
4 | 2 | 20µs | 2 | 27µs | # spent 18µs (9+9) within Moose::Meta::Method::Overridden::BEGIN@4 which was called: # once (9µs+9µs) by Moose::Meta::Class::BEGIN@13 at line 4 use strict; # spent 18µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@4 # spent 9µs making 1 call to strict::import
5 | 2 | 31µs | 2 | 24µs | # spent 21µs (18+4) within Moose::Meta::Method::Overridden::BEGIN@5 which was called: # once (18µs+4µs) by Moose::Meta::Class::BEGIN@13 at line 5 use warnings; # spent 21µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@5 # spent 4µs making 1 call to warnings::import
6 |  |  |  |  |
7 | 2 | 34µs | 2 | 12.1ms | # spent 6.07ms (8µs+6.06) within Moose::Meta::Method::Overridden::BEGIN@7 which was called: # once (8µs+6.06ms) by Moose::Meta::Class::BEGIN@13 at line 7 use parent 'Moose::Meta::Method'; # spent 6.07ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@7 # spent 6.06ms making 1 call to parent::import
8 |  |  |  |  |
9 | 2 | 155µs | 2 | 328µs | # spent 168µs (8+160) within Moose::Meta::Method::Overridden::BEGIN@9 which was called: # once (8µs+160µs) by Moose::Meta::Class::BEGIN@13 at line 9 use Moose::Util 'throw_exception'; # spent 168µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@9 # spent 160µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
10 |  |  |  |  |
11 |  |  |  |  | # spent 2.43ms (378µs+2.05) within Moose::Meta::Method::Overridden::new which was called 25 times, avg 97µs/call: # 25 times (378µs+2.05ms) by Moose::Meta::Class::add_override_method_modifier at line 590 of Moose/Meta/Class.pm, avg 97µs/call sub new {
12 | 25 | 37µs |  |  | my ( $class, %args ) = @_;
13 |  |  |  |  |
14 |  |  |  |  | # the package can be overridden by roles
15 |  |  |  |  | # it is really more like body's compilation stash
16 |  |  |  |  | # this is where we need to override the definition of super() so that the
17 |  |  |  |  | # body of the code can call the right overridden version
18 | 25 | 18µs | 1 | 400ns | my $super_package = $args{package} || $args{class}->name; # spent 400ns making 1 call to Class::MOP::Package::name
19 |  |  |  |  |
20 | 25 | 7µs |  |  | my $name = $args{name};
21 |  |  |  |  |
22 | 25 | 38µs | 25 | 1.44ms | my $super = $args{class}->find_next_method_by_name($name); # spent 1.44ms making 25 calls to Class::MOP::Class::find_next_method_by_name, avg 57µs/call
23 |  |  |  |  |
24 | 25 | 5µs |  |  | (defined $super)
25 |  |  |  |  | || throw_exception( CannotOverrideNoSuperMethod => class => $class,
26 |  |  |  |  | params => \%args,
27 |  |  |  |  | method_name => $name
28 |  |  |  |  | );
29 |  |  |  |  |
30 | 25 | 63µs | 25 | 18µs | my $super_body = $super->body; # spent 18µs making 25 calls to Class::MOP::Method::body, avg 716ns/call
31 |  |  |  |  |
32 | 25 | 8µs |  |  | my $method = $args{method};
33 |  |  |  |  |
34 |  |  |  |  | my $body = sub {
35 | 100 | 70µs |  |  | local $Moose::SUPER_PACKAGE = $super_package;
36 | 100 | 128µs |  |  | local @Moose::SUPER_ARGS = @_;
37 | 100 | 40µs |  |  | local $Moose::SUPER_BODY = $super_body;
38 | 100 | 426µs | 100 | 14.7ms | return $method->(@_); # spent 11.9ms making 50 calls to Moose::Meta::Method::Accessor::Native::__ANON__[Moose/Meta/Method/Accessor/Native.pm:147], avg 237µs/call # spent 2.79ms making 50 calls to Moose::Meta::Method::Accessor::Native::__ANON__[Moose/Meta/Method/Accessor/Native.pm:116], avg 56µs/call
39 | 25 | 70µs |  |  | };
40 |  |  |  |  |
41 |  |  |  |  | # FIXME do we need this make sure this works for next::method?
42 |  |  |  |  | # subname "${super_package}::${name}", $method;
43 |  |  |  |  |
44 |  |  |  |  | # FIXME store additional attrs
45 | 25 | 137µs | 50 | 598µs | $class->wrap( # spent 587µs making 25 calls to Class::MOP::Method::wrap, avg 23µs/call # spent 11µs making 25 calls to Class::MOP::Package::name, avg 424ns/call
46 |  |  |  |  | $body,
47 |  |  |  |  | package_name => $args{class}->name,
48 |  |  |  |  | name => $name
49 |  |  |  |  | );
50 |  |  |  |  | }
51 |  |  |  |  |
52 | 1 | 2µs |  |  | 1;
53 |  |  |  |  |
54 |  |  |  |  | # ABSTRACT: A Moose Method metaclass for overridden methods
55 |  |  |  |  |
56 |  |  |  |  | __END__