← Index
Performance Profile   « block view • line view • sub view »
For t/test-parsing
  Run on Sun Nov 14 09:49:57 2010
Reported on Sun Nov 14 09:50:07 2010

File /usr/local/lib/perl/5.10.0/Sub/Name.pm
Statements Executed 20
Total Time 0.0002793 seconds
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
435553.98ms3.98msSub::Name::::subnameSub::Name::subname(xsub)
21233µs33µsSub::Name::::bootstrapSub::Name::bootstrap(xsub)
0000s0sSub::Name::::BEGINSub::Name::BEGIN
LineStmts.Exclusive
Time
Avg.Code
1package Sub::Name;
2
3=head1 NAME
4
5Sub::Name - (re)name a sub
6
7=head1 SYNOPSIS
8
9 use Sub::Name;
10
11 subname $name, $subref;
12
13 $subref = subname foo => sub { ... };
14
15=head1 DESCRIPTION
16
17This module has only one function, which is also exported by default:
18
19=head2 subname NAME, CODEREF
20
21Assigns a new name to referenced sub. If package specification is omitted in
22the name, then the current package is used. The return value is the sub.
23
24The name is only used for informative routines (caller, Carp, etc). You won't
25be able to actually invoke the sub by the given name. To allow that, you need
26to do glob-assignment yourself.
27
28Note that for anonymous closures (subs that reference lexicals declared outside
29the sub itself) you can name each instance of the closure differently, which
30can be very useful for debugging.
31
32=head1 AUTHOR
33
34Matthijs van Duin <xmath@cpan.org>
35
36Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
37This program is free software; you can redistribute it and/or modify
38it under the same terms as Perl itself.
39
40=cut
41
42392µs31µsuse 5.006;
43
44332µs11µsuse strict;
# spent 7µs making 1 call to strict::import
45350µs17µsuse warnings;
# spent 30µs making 1 call to warnings::import
46
471700ns700nsour $VERSION = '0.04';
48
49326µs9µsuse base 'Exporter';
# spent 65µs making 1 call to base::import
50360µs20µsuse base 'DynaLoader';
# spent 68µs making 1 call to base::import
51
5211µs1µsour @EXPORT = qw(subname);
531900ns900nsour @EXPORT_OK = @EXPORT;
54
5519µs9µsbootstrap Sub::Name $VERSION;
# spent 243µs making 1 call to DynaLoader::bootstrap
56
5717µs7µs1;
# spent 33µs within Sub::Name::bootstrap which was called # once (33µs+0s) by DynaLoader::bootstrap at line 219 of /usr/lib/perl/5.10/DynaLoader.pm
sub Sub::Name::bootstrap; # xsub
# spent 3.98ms within Sub::Name::subname which was called 434 times, avg 9µs/call: # 326 times (3.18ms+0s) by Class::MOP::Mixin::HasMethods::add_method at line 88 of /usr/local/lib/perl/5.10.0/Class/MOP/Mixin/HasMethods.pm, avg 10µs/call # 56 times (384µs+0s) by Moose::Exporter::_make_wrapped_sub_with_meta or Moose::Exporter::__ANON__[/usr/local/lib/perl/5.10.0/Moose/Exporter.pm:292] at line 287 of /usr/local/lib/perl/5.10.0/Moose/Exporter.pm, avg 7µs/call # 46 times (368µs+0s) by Class::MOP::Class::add_around_method_modifier at line 962 of /usr/local/lib/perl/5.10.0/Class/MOP/Class.pm, avg 8µs/call # 5 times (39µs+0s) by Moose::Meta::TypeConstraint::_compile_subtype or Moose::Meta::TypeConstraint::__ANON__[/usr/local/lib/perl/5.10.0/Moose/Meta/TypeConstraint.pm:268] at line 268 of /usr/local/lib/perl/5.10.0/Moose/Meta/TypeConstraint.pm, avg 8µs/call # once (8µs+0s) by Moose::Meta::TypeConstraint::_compile_type or Moose::Meta::TypeConstraint::__ANON__[/usr/local/lib/perl/5.10.0/Moose/Meta/TypeConstraint.pm:281] at line 281 of /usr/local/lib/perl/5.10.0/Moose/Meta/TypeConstraint.pm
sub Sub::Name::subname; # xsub