← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Overridden.pm
StatementsExecuted 407 statements in 746µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2111286µs1.67msMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
11126µs37µsMoose::Meta::Method::Overridden::::BEGIN@9Moose::Meta::Method::Overridden::BEGIN@9
1118µs8µsMoose::Meta::Method::Overridden::::BEGIN@2Moose::Meta::Method::Overridden::BEGIN@2
1117µs2.14msMoose::Meta::Method::Overridden::::BEGIN@12Moose::Meta::Method::Overridden::BEGIN@12
1117µs10µsMoose::Meta::Method::Overridden::::BEGIN@10Moose::Meta::Method::Overridden::BEGIN@10
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;
2
# spent 8µs within Moose::Meta::Method::Overridden::BEGIN@2 which was called: # once (8µs+0s) by Moose::Meta::Class::BEGIN@21 at line 4
BEGIN {
314µs $Moose::Meta::Method::Overridden::AUTHORITY = 'cpan:STEVAN';
4136µs18µs}
# spent 8µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@2
5{
62900ns $Moose::Meta::Method::Overridden::VERSION = '2.1005';
7}
8
9223µs248µs
# spent 37µs (26+11) within Moose::Meta::Method::Overridden::BEGIN@9 which was called: # once (26µs+11µs) by Moose::Meta::Class::BEGIN@21 at line 9
use strict;
# spent 37µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@9 # spent 11µs making 1 call to strict::import
10221µs213µs
# spent 10µs (7+3) within Moose::Meta::Method::Overridden::BEGIN@10 which was called: # once (7µs+3µs) by Moose::Meta::Class::BEGIN@21 at line 10
use warnings;
# spent 10µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@10 # spent 3µs making 1 call to warnings::import
11
122175µs24.28ms
# spent 2.14ms (7µs+2.13) within Moose::Meta::Method::Overridden::BEGIN@12 which was called: # once (7µs+2.13ms) by Moose::Meta::Class::BEGIN@21 at line 12
use base 'Moose::Meta::Method';
# spent 2.14ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@12 # spent 2.13ms making 1 call to base::import
13
14
# spent 1.67ms (286µs+1.38) within Moose::Meta::Method::Overridden::new which was called 21 times, avg 80µs/call: # 21 times (286µs+1.38ms) by Moose::Meta::Class::add_override_method_modifier at line 595 of Moose/Meta/Class.pm, avg 80µs/call
sub new {
152126µs my ( $class, %args ) = @_;
16
17 # the package can be overridden by roles
18 # it is really more like body's compilation stash
19 # this is where we need to override the definition of super() so that the
20 # body of the code can call the right overridden version
21218µs my $super_package = $args{package} || $args{class}->name;
22
23213µs my $name = $args{name};
24
252120µs21909µs my $super = $args{class}->find_next_method_by_name($name);
# spent 909µs making 21 calls to Class::MOP::Class::find_next_method_by_name, avg 43µs/call
26
27211µs (defined $super)
28 || $class->throw_error("You cannot override '$name' because it has no super method", data => $name);
29
302144µs2111µs my $super_body = $super->body;
# spent 11µs making 21 calls to Class::MOP::Method::body, avg 538ns/call
31
32213µs my $method = $args{method};
33
34 my $body = sub {
355217µs local $Moose::SUPER_PACKAGE = $super_package;
365237µs local @Moose::SUPER_ARGS = @_;
37527µs local $Moose::SUPER_BODY = $super_body;
3852152µs523.82ms return $method->(@_);
392157µ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
4521107µs42464µs $class->wrap(
# spent 454µs making 21 calls to Class::MOP::Method::wrap, avg 22µs/call # spent 11µs making 21 calls to Class::MOP::Package::name, avg 510ns/call
46 $body,
47 package_name => $args{class}->name,
48 name => $name
49 );
50}
51
5213µs1;
53
54# ABSTRACT: A Moose Method metaclass for overridden methods
55
56__END__