← 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
StatementsExecuted 635 statements in 1.29ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2511378µs2.43msMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
11118µs21µsMoose::Meta::Method::Overridden::::BEGIN@5Moose::Meta::Method::Overridden::BEGIN@5
1119µs18µsMoose::Meta::Method::Overridden::::BEGIN@4Moose::Meta::Method::Overridden::BEGIN@4
1118µs168µsMoose::Meta::Method::Overridden::::BEGIN@9Moose::Meta::Method::Overridden::BEGIN@9
1118µs6.07msMoose::Meta::Method::Overridden::::BEGIN@7Moose::Meta::Method::Overridden::BEGIN@7
0000s0sMoose::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
1package Moose::Meta::Method::Overridden;
21400nsour $VERSION = '2.1604';
3
4220µs227µ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
5231µs224µ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
7234µs212.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
92155µs2328µ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 {
122537µ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
182518µs1400ns my $super_package = $args{package} || $args{class}->name;
# spent 400ns making 1 call to Class::MOP::Package::name
19
20257µs my $name = $args{name};
21
222538µs251.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
24255µs (defined $super)
25 || throw_exception( CannotOverrideNoSuperMethod => class => $class,
26 params => \%args,
27 method_name => $name
28 );
29
302563µs2518µs my $super_body = $super->body;
# spent 18µs making 25 calls to Class::MOP::Method::body, avg 716ns/call
31
32258µs my $method = $args{method};
33
34 my $body = sub {
3510070µs local $Moose::SUPER_PACKAGE = $super_package;
36100128µs local @Moose::SUPER_ARGS = @_;
3710040µs local $Moose::SUPER_BODY = $super_body;
38100426µs10014.7ms return $method->(@_);
392570µ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
4525137µs50598µ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
5212µs1;
53
54# ABSTRACT: A Moose Method metaclass for overridden methods
55
56__END__