← 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:10 2010

File /usr/local/lib/perl5/5.10.1/vars.pm
Statements Executed 543
Statement Execution Time 2.35ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3636311.37ms1.73msvars::::importvars::import
29132354µs354µsvars::::CORE:matchvars::CORE:match (opcode)
111260µs335µsvars::::BEGIN@7vars::BEGIN@7
11129µs29µsvars::::BEGIN@3vars::BEGIN@3
1117µs22µsvars::::BEGIN@8vars::BEGIN@8
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package vars;
2
3353µs129µs
# spent 29µs within vars::BEGIN@3 which was called # once (29µs+0s) by Scalar::Util::BEGIN@10 at line 3
use 5.006;
# spent 29µs making 1 call to vars::BEGIN@3
4
51800nsour $VERSION = '1.01';
6
73277µs2410µs
# spent 335µs (260+75) within vars::BEGIN@7 which was called # once (260µs+75µs) by Scalar::Util::BEGIN@10 at line 7
use warnings::register;
# spent 335µs making 1 call to vars::BEGIN@7 # spent 75µs making 1 call to warnings::register::import
83288µs236µs
# spent 22µs (7+15) within vars::BEGIN@8 which was called # once (7µs+15µs) by Scalar::Util::BEGIN@10 at line 8
use strict qw(vars subs);
# spent 22µs making 1 call to vars::BEGIN@8 # spent 14µs making 1 call to strict::import
9
10
# spent 1.73ms (1.37+354µs) within vars::import which was called 36 times, avg 48µs/call: # once (94µs+26µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (65µs+21µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm # once (68µs+13µs) by LWP::ConnCache::BEGIN@4 at line 4 of LWP/ConnCache.pm # once (61µs+18µs) by Try::Tiny::BEGIN@6 at line 6 of Try/Tiny.pm # once (61µs+14µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm # once (57µs+18µs) by HTTP::Status::BEGIN@6 at line 6 of HTTP/Status.pm # once (53µs+15µs) by MIME::Base64::BEGIN@4 at line 4 of MIME/Base64.pm # once (50µs+13µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (52µs+10µs) by Net::HTTP::BEGIN@4 at line 4 of Net/HTTP.pm # once (49µs+11µs) by Digest::SHA::BEGIN@7 at line 7 of Digest/SHA.pm # once (47µs+10µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm # once (40µs+16µs) by Time::Local::BEGIN@9 at line 9 of Time/Local.pm # once (39µs+14µs) by constant::BEGIN@6 at line 6 of constant.pm # once (41µs+9µs) by LWP::Protocol::http::BEGIN@9 at line 9 of LWP/Protocol/http.pm # once (41µs+8µs) by URI::BEGIN@13 at line 13 of URI.pm # once (34µs+13µs) by LWP::UserAgent::BEGIN@4 at line 4 of LWP/UserAgent.pm # once (39µs+8µs) by URI::Escape::BEGIN@141 at line 141 of URI/Escape.pm # once (39µs+8µs) by XML::Bare::BEGIN@5 at line 5 of XML/Bare.pm # once (37µs+9µs) by IO::Select::BEGIN@11 at line 11 of IO/Select.pm # once (35µs+7µs) by Devel::GlobalDestruction::BEGIN@8 at line 8 of Devel/GlobalDestruction.pm # once (35µs+6µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (33µs+7µs) by Storable::BEGIN@24 at line 24 of Storable.pm # once (31µs+7µs) by HTTP::Headers::BEGIN@6 at line 6 of HTTP/Headers.pm # once (30µs+7µs) by HTTP::Date::BEGIN@14 at line 14 of HTTP/Date.pm # once (25µs+11µs) by base::BEGIN@4 at line 4 of base.pm # once (28µs+9µs) by HTTP::Message::BEGIN@4 at line 4 of HTTP/Message.pm # once (28µs+6µs) by URI::BEGIN@7 at line 7 of URI.pm # once (26µs+7µs) by LWP::Protocol::http::Socket::BEGIN@472 at line 472 of LWP/Protocol/http.pm # once (24µs+6µs) by XML::Bare::BEGIN@15 at line 15 of XML/Bare.pm # once (23µs+4µs) by HTTP::Config::BEGIN@5 at line 5 of HTTP/Config.pm # once (16µs+4µs) by Net::HTTP::Methods::BEGIN@6 at line 6 of Net/HTTP/Methods.pm # once (15µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm # once (15µs+4µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm # once (14µs+4µs) by Class::Data::Inheritable::BEGIN@4 at line 4 of Class/Data/Inheritable.pm # once (14µs+3µs) by URI::BEGIN@4 at line 4 of URI.pm # once (13µs+2µs) by URI::Escape::BEGIN@142 at line 142 of URI/Escape.pm
sub import {
11144288µs my $callpack = caller;
12 my ($pack, @imports) = @_;
13 my ($sym, $ch);
14 foreach (@imports) {
153881.44ms97253µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 253µs making 97 calls to vars::CORE:match, avg 3µs/call
16 if ($sym =~ /\W/) {
# spent 49µs making 97 calls to vars::CORE:match, avg 506ns/call
17 # time for a more-detailed check-up
18 if ($sym =~ /^\w+[[{].*[]}]$/) {
19 require Carp;
20 Carp::croak("Can't declare individual elements of hash or array");
21 } elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) {
22 warnings::warn("No need to declare built-in vars");
23 } elsif (($^H &= strict::bits('vars'))) {
24 require Carp;
25 Carp::croak("'$_' is not a valid variable name under strict vars");
26 }
27 }
28 $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 52µs making 97 calls to vars::CORE:match, avg 539ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35 : do {
36 require Carp;
37 Carp::croak("'$_' is not a valid variable name");
38 });
39 } else {
40 require Carp;
41 Carp::croak("'$_' is not a valid variable name");
42 }
43 }
44};
45
4614µs1;
47__END__
48
49=head1 NAME
50
51vars - Perl pragma to predeclare global variable names (obsolete)
52
53=head1 SYNOPSIS
54
55 use vars qw($frob @mung %seen);
56
57=head1 DESCRIPTION
58
59NOTE: For variables in the current package, the functionality provided
60by this pragma has been superseded by C<our> declarations, available
61in Perl v5.6.0 or later. See L<perlfunc/our>.
62
63This will predeclare all the variables whose names are
64in the list, allowing you to use them under "use strict", and
65disabling any typo warnings.
66
67Unlike pragmas that affect the C<$^H> hints variable, the C<use vars> and
68C<use subs> declarations are not BLOCK-scoped. They are thus effective
69for the entire file in which they appear. You may not rescind such
70declarations with C<no vars> or C<no subs>.
71
72Packages such as the B<AutoLoader> and B<SelfLoader> that delay
73loading of subroutines within packages can create problems with
74package lexicals defined using C<my()>. While the B<vars> pragma
75cannot duplicate the effect of package lexicals (total transparency
76outside of the package), it can act as an acceptable substitute by
77pre-declaring global symbols, ensuring their availability to the
78later-loaded routines.
79
80See L<perlmodlib/Pragmatic Modules>.
81
82=cut
# spent 354µs within vars::CORE:match which was called 291 times, avg 1µs/call: # 97 times (253µs+0s) by vars::import at line 15 of vars.pm, avg 3µs/call # 97 times (52µs+0s) by vars::import at line 28 of vars.pm, avg 539ns/call # 97 times (49µs+0s) by vars::import at line 16 of vars.pm, avg 506ns/call
sub vars::CORE:match; # xsub