← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:46:01 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Method/Overridden.pm
StatementsExecuted 10 statements in 450µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs327µsMoose::Meta::Method::Overridden::::BEGIN@9Moose::Meta::Method::Overridden::BEGIN@9
11113µs26µsMoose::Meta::Method::Overridden::::BEGIN@4Moose::Meta::Method::Overridden::BEGIN@4
11112µs3.70msMoose::Meta::Method::Overridden::::BEGIN@7Moose::Meta::Method::Overridden::BEGIN@7
1118µs12µsMoose::Meta::Method::Overridden::::BEGIN@5Moose::Meta::Method::Overridden::BEGIN@5
0000s0sMoose::Meta::Method::Overridden::::__ANON__[:39]Moose::Meta::Method::Overridden::__ANON__[:39]
0000s0sMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::new
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;
211µsour $VERSION = '2.1403';
3
4227µs239µs
# spent 26µs (13+13) within Moose::Meta::Method::Overridden::BEGIN@4 which was called: # once (13µs+13µs) by Moose::Meta::Class::BEGIN@13 at line 4
use strict;
# spent 26µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@4 # spent 13µs making 1 call to strict::import
5223µs216µs
# spent 12µs (8+4) within Moose::Meta::Method::Overridden::BEGIN@5 which was called: # once (8µs+4µs) by Moose::Meta::Class::BEGIN@13 at line 5
use warnings;
# spent 12µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@5 # spent 4µs making 1 call to warnings::import
6
7272µs27.38ms
# spent 3.70ms (12µs+3.68) within Moose::Meta::Method::Overridden::BEGIN@7 which was called: # once (12µs+3.68ms) by Moose::Meta::Class::BEGIN@13 at line 7
use parent 'Moose::Meta::Method';
# spent 3.70ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@7 # spent 3.68ms making 1 call to parent::import
8
92322µs2636µs
# spent 327µs (18+309) within Moose::Meta::Method::Overridden::BEGIN@9 which was called: # once (18µs+309µs) by Moose::Meta::Class::BEGIN@13 at line 9
use Moose::Util 'throw_exception';
# spent 327µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@9 # spent 309µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
10
11sub new {
12 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 my $super_package = $args{package} || $args{class}->name;
19
20 my $name = $args{name};
21
22 my $super = $args{class}->find_next_method_by_name($name);
23
24 (defined $super)
25 || throw_exception( CannotOverrideNoSuperMethod => class => $class,
26 params => \%args,
27 method_name => $name
28 );
29
30 my $super_body = $super->body;
31
32 my $method = $args{method};
33
34 my $body = sub {
35 local $Moose::SUPER_PACKAGE = $super_package;
36 local @Moose::SUPER_ARGS = @_;
37 local $Moose::SUPER_BODY = $super_body;
38 return $method->(@_);
39 };
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 $class->wrap(
46 $body,
47 package_name => $args{class}->name,
48 name => $name
49 );
50}
51
5215µs1;
53
54# ABSTRACT: A Moose Method metaclass for overridden methods
55
56__END__