← 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/Sub/Name.pm
StatementsExecuted 15 statements in 176µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1963743.59ms3.59msSub::Name::::subnameSub::Name::subname (xsub)
11119µs19µsSub::Name::::bootstrapSub::Name::bootstrap (xsub)
11113µs13µsSub::Name::::BEGIN@42Sub::Name::BEGIN@42
1115µs48µsSub::Name::::BEGIN@50Sub::Name::BEGIN@50
1115µs8µsSub::Name::::BEGIN@45Sub::Name::BEGIN@45
1115µs15µsSub::Name::::BEGIN@44Sub::Name::BEGIN@44
1115µs54µsSub::Name::::BEGIN@49Sub::Name::BEGIN@49
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
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
42239µs113µs
# spent 13µs within Sub::Name::BEGIN@42 which was called: # once (13µs+0s) by Try::Tiny::BEGIN@1 at line 42
use 5.006;
# spent 13µs making 1 call to Sub::Name::BEGIN@42
43
44218µs225µs
# spent 15µs (5+10) within Sub::Name::BEGIN@44 which was called: # once (5µs+10µs) by Try::Tiny::BEGIN@1 at line 44
use strict;
# spent 15µs making 1 call to Sub::Name::BEGIN@44 # spent 10µs making 1 call to strict::import
45226µs211µs
# spent 8µs (5+3) within Sub::Name::BEGIN@45 which was called: # once (5µs+3µs) by Try::Tiny::BEGIN@1 at line 45
use warnings;
# spent 8µs making 1 call to Sub::Name::BEGIN@45 # spent 3µs making 1 call to warnings::import
46
471400nsour $VERSION = '0.05';
48
49231µs2103µs
# spent 54µs (5+49) within Sub::Name::BEGIN@49 which was called: # once (5µs+49µs) by Try::Tiny::BEGIN@1 at line 49
use base 'Exporter';
# spent 54µs making 1 call to Sub::Name::BEGIN@49 # spent 49µs making 1 call to base::import
50252µs292µs
# spent 48µs (5+43) within Sub::Name::BEGIN@50 which was called: # once (5µs+43µs) by Try::Tiny::BEGIN@1 at line 50
use base 'DynaLoader';
# spent 48µs making 1 call to Sub::Name::BEGIN@50 # spent 43µs making 1 call to base::import
51
521600nsour @EXPORT = qw(subname);
531400nsour @EXPORT_OK = @EXPORT;
54
5514µs1173µsbootstrap Sub::Name $VERSION;
# spent 173µs making 1 call to DynaLoader::bootstrap
56
5714µs1;
 
# spent 19µs within Sub::Name::bootstrap which was called: # once (19µs+0s) by DynaLoader::bootstrap at line 217 of DynaLoader.pm
sub Sub::Name::bootstrap; # xsub
# spent 3.59ms within Sub::Name::subname which was called 1963 times, avg 2µs/call: # 650 times (1.29ms+0s) by Try::Tiny::try at line 60 of Try/Tiny.pm, avg 2µs/call # 621 times (878µs+0s) by Try::Tiny::try at line 61 of Try/Tiny.pm, avg 1µs/call # 448 times (1.03ms+0s) by Class::MOP::Mixin::HasMethods::add_method at line 83 of Class/MOP/Mixin/HasMethods.pm, avg 2µs/call # 176 times (289µs+0s) by Moose::Exporter::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Exporter.pm:379] at line 374 of Moose/Exporter.pm, avg 2µs/call # 65 times (104µs+0s) by Class::MOP::Class::add_around_method_modifier at line 1099 of Class/MOP/Class.pm, avg 2µs/call # 2 times (3µs+0s) by Class::MOP::Class::add_before_method_modifier at line 1079 of Class/MOP/Class.pm, avg 2µs/call # once (2µs+0s) by Class::MOP::Class::add_after_method_modifier at line 1089 of Class/MOP/Class.pm
sub Sub::Name::subname; # xsub