← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 01.HTTP.t
  Run on Tue May 4 15:25:55 2010
Reported on Tue May 4 15:26:04 2010

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP/Method/Generated.pm
Statements Executed 1633
Statement Execution Time 15.9ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1226312.6ms12.6msClass::MOP::Method::Generated::::_eval_closureClass::MOP::Method::Generated::_eval_closure
1111.14ms1.54msClass::MOP::Method::Generated::::BEGIN@15Class::MOP::Method::Generated::BEGIN@15
20322232µs232µsClass::MOP::Method::Generated::::is_inlineClass::MOP::Method::Generated::is_inline
833124µs1.39msClass::MOP::Method::Generated::::_compile_codeClass::MOP::Method::Generated::_compile_code
811105µs116µsClass::MOP::Method::Generated::::_add_line_directiveClass::MOP::Method::Generated::_add_line_directive
491265µs65µsClass::MOP::Method::Generated::::CORE:matchClass::MOP::Method::Generated::CORE:match (opcode)
11122µs27µsClass::MOP::Method::Generated::::BEGIN@4Class::MOP::Method::Generated::BEGIN@4
11114µs81µsClass::MOP::Method::Generated::::BEGIN@13Class::MOP::Method::Generated::BEGIN@13
11112µs26µsClass::MOP::Method::Generated::::BEGIN@5Class::MOP::Method::Generated::BEGIN@5
81111µs11µsClass::MOP::Method::Generated::::definition_contextClass::MOP::Method::Generated::definition_context
11110µs47µsClass::MOP::Method::Generated::::BEGIN@7Class::MOP::Method::Generated::BEGIN@7
0000s0sClass::MOP::Method::Generated::::_initialize_bodyClass::MOP::Method::Generated::_initialize_body
0000s0sClass::MOP::Method::Generated::::newClass::MOP::Method::Generated::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Class::MOP::Method::Generated;
3
4343µs231µs
# spent 27µs (22+4) within Class::MOP::Method::Generated::BEGIN@4 which was called # once (22µs+4µs) by base::import at line 4
use strict;
# spent 27µs making 1 call to Class::MOP::Method::Generated::BEGIN@4 # spent 4µs making 1 call to strict::import
5336µs240µs
# spent 26µs (12+14) within Class::MOP::Method::Generated::BEGIN@5 which was called # once (12µs+14µs) by base::import at line 5
use warnings;
# spent 26µs making 1 call to Class::MOP::Method::Generated::BEGIN@5 # spent 14µs making 1 call to warnings::import
6
7380µs284µs
# spent 47µs (10+37) within Class::MOP::Method::Generated::BEGIN@7 which was called # once (10µs+37µs) by base::import at line 7
use Carp 'confess';
# spent 47µs making 1 call to Class::MOP::Method::Generated::BEGIN@7 # spent 37µs making 1 call to Exporter::import
8
91800nsour $VERSION = '0.98';
10119µs$VERSION = eval $VERSION;
111500nsour $AUTHORITY = 'cpan:STEVAN';
12
13374µs281µs
# spent 81µs (14+67) within Class::MOP::Method::Generated::BEGIN@13 which was called # once (14µs+67µs) by base::import at line 13
use base 'Class::MOP::Method';
# spent 81µs making 1 call to Class::MOP::Method::Generated::BEGIN@13 # spent 67µs making 1 call to base::import, recursion: max depth 1, time 67µs
14
153593µs21.63ms
# spent 1.54ms (1.14+403µs) within Class::MOP::Method::Generated::BEGIN@15 which was called # once (1.14ms+403µs) by base::import at line 15
use constant _PRINT_SOURCE => $ENV{MOP_PRINT_SOURCE} ? 1 : 0;
# spent 1.54ms making 1 call to Class::MOP::Method::Generated::BEGIN@15 # spent 85µs making 1 call to constant::import
16
17## accessors
18
19sub new {
20 confess __PACKAGE__ . " is an abstract base class, you must provide a constructor.";
21}
22
23203369µs
# spent 232µs within Class::MOP::Method::Generated::is_inline which was called 203 times, avg 1µs/call: # 172 times (193µs+0s) by Class::MOP::Method::Accessor::_initialize_body at line 80 of Class/MOP/Method/Accessor.pm, avg 1µs/call # 31 times (38µs+0s) by Class::MOP::Method::Constructor::_initialize_body at line 91 of Class/MOP/Method/Constructor.pm, avg 1µs/call
sub is_inline { $_[0]{is_inline} }
24
25821µs
# spent 11µs within Class::MOP::Method::Generated::definition_context which was called 8 times, avg 1µs/call: # 8 times (11µs+0s) by Class::MOP::Method::Generated::_add_line_directive at line 66, avg 1µs/call
sub definition_context { $_[0]{definition_context} }
26
27sub _initialize_body {
28 confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
29}
30
31
# spent 12.6ms (12.6+65µs) within Class::MOP::Method::Generated::_eval_closure which was called 122 times, avg 104µs/call: # 52 times (3.06ms+0s) by Class::MOP::Method::Accessor::_generate_reader_method_inline at line 157 of Class/MOP/Method/Accessor.pm, avg 59µs/call # 31 times (6.73ms+37µs) by Class::MOP::Method::Constructor::_generate_constructor_method_inline at line 121 of Class/MOP/Method/Constructor.pm, avg 218µs/call # 15 times (902µs+0s) by Class::MOP::Method::Accessor::_generate_accessor_method_inline at line 138 of Class/MOP/Method/Accessor.pm, avg 60µs/call # 13 times (599µs+0s) by Class::MOP::Method::Accessor::_generate_predicate_method_inline at line 192 of Class/MOP/Method/Accessor.pm, avg 46µs/call # 8 times (1.13ms+27µs) by Class::MOP::Method::Generated::_compile_code at line 91, avg 144µs/call # 3 times (144µs+0s) by Class::MOP::Method::Accessor::_generate_writer_method_inline at line 175 of Class/MOP/Method/Accessor.pm, avg 48µs/call
sub _eval_closure {
32 # my ($self, $captures, $sub_body) = @_;
33131811.9ms my $__captures = $_[1];
34
35 my $code;
36
37 my $e = do {
38 local $@;
39 local $SIG{__DIE__};
40 my $source = join
# spent 65µs making 49 calls to Class::MOP::Method::Generated::CORE:match, avg 1µs/call
41 "\n", (
42 map {
43 /^([\@\%\$])/
44 or die "capture key should start with \@, \% or \$: $_";
45 q[my ]
46 . $_ . q[ = ]
47 . $1
48 . q[{$__captures->{']
49 . $_ . q['}};];
50 } keys %$__captures
51 ),
52 $_[2];
53 print STDERR "\n", $_[0]->name, ":\n", $source, "\n" if _PRINT_SOURCE;
5412.53ms612µs $code = eval $source;
# spent 7µs making 4 calls to Class::MOP::__ANON__[Class/MOP.pm:494], avg 2µs/call # spent 5µs making 2 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:30], avg 2µs/call
55 $@;
56 };
57
58 return ( $code, $e );
59}
60
61
# spent 116µs (105+11) within Class::MOP::Method::Generated::_add_line_directive which was called 8 times, avg 14µs/call: # 8 times (105µs+11µs) by Class::MOP::Method::Generated::_compile_code at line 89, avg 14µs/call
sub _add_line_directive {
626094µs my ( $self, %args ) = @_;
63
64 my ( $line, $file );
65
66 if ( my $ctx = ( $args{context} || $self->definition_context ) ) {
# spent 11µs making 8 calls to Class::MOP::Method::Generated::definition_context, avg 1µs/call
67 $line = $ctx->{line};
68 if ( my $desc = $ctx->{description} ) {
69 $file = "$desc defined at $ctx->{file}";
70 } else {
71 $file = $ctx->{file};
72 }
73 } else {
74 ( $line, $file ) = ( 0, "generated method (unknown origin)" );
75 }
76
77 my $code = $args{code};
78
79 # if it's an array of lines, join it up
80 # don't use newlines so that the definition context is more meaningful
81 $code = join(@$code, ' ') if ref $code;
82
83 return qq{#line $line "$file"\n} . $code;
84}
85
86
# spent 1.39ms (124µs+1.27) within Class::MOP::Method::Generated::_compile_code which was called 8 times, avg 174µs/call: # 6 times (89µs+902µs) by Moose::Meta::Method::Accessor::_eval_code at line 36 of Moose/Meta/Method/Accessor.pm, avg 165µs/call # once (19µs+314µs) by Moose::Meta::Method::Constructor::_initialize_body at line 96 of Moose/Meta/Method/Constructor.pm # once (16µs+54µs) by Moose::Meta::Method::Destructor::_initialize_body at line 108 of Moose/Meta/Method/Destructor.pm
sub _compile_code {
8724103µs my ( $self, %args ) = @_;
88
89 my $code = $self->_add_line_directive(%args);
# spent 116µs making 8 calls to Class::MOP::Method::Generated::_add_line_directive, avg 14µs/call
90
91 return $self->_eval_closure($args{environment}, $code);
# spent 1.15ms making 8 calls to Class::MOP::Method::Generated::_eval_closure, avg 144µs/call
92}
93
9416µs1;
95
96__END__
97
98=pod
99
100=head1 NAME
101
102Class::MOP::Method::Generated - Abstract base class for generated methods
103
104=head1 DESCRIPTION
105
106This is a C<Class::MOP::Method> subclass which is subclassed by
107C<Class::MOP::Method::Accessor> and
108C<Class::MOP::Method::Constructor>.
109
110It is not intended to be used directly.
111
112=head1 AUTHORS
113
114Stevan Little E<lt>stevan@iinteractive.comE<gt>
115
116=head1 COPYRIGHT AND LICENSE
117
118Copyright 2006-2010 by Infinity Interactive, Inc.
119
120L<http://www.iinteractive.com>
121
122This library is free software; you can redistribute it and/or modify
123it under the same terms as Perl itself.
124
125=cut
126
# spent 65µs within Class::MOP::Method::Generated::CORE:match which was called 49 times, avg 1µs/call: # 49 times (65µs+0s) by Class::MOP::Method::Generated::_eval_closure at line 40 of Class/MOP/Method/Generated.pm, avg 1µs/call
sub Class::MOP::Method::Generated::CORE:match; # xsub