Profile of vars.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For xt/tapper-mcp-scheduler-with-db-longrun.t
Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:34 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/5.12.3/vars.pm
Statements | Executed 1187 statements in 3.95ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
74 | 74 | 66 | 2.64ms | 3.29ms | vars::::importvars::import
660 | 3 | 1 | 651µs | 651µs | vars::::CORE:matchvars::CORE:match (opcode)
1 | 1 | 1 | 196µs | 255µs | vars::::BEGIN@7vars::BEGIN@7
1 | 1 | 1 | 28µs | 28µs | vars::::BEGIN@3vars::BEGIN@3
1 | 1 | 1 | 5µs | 13µs | vars::::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package vars;
2 |  |  |  |  |
3 | 3 | 48µs | 1 | 28µs | # spent 28µs within vars::BEGIN@3 which was called: # once (28µs+0s) by base::BEGIN@4 at line 3 use 5.006; # spent 28µs making 1 call to vars::BEGIN@3
4 |  |  |  |  |
5 | 1 | 500ns |  |  | our $VERSION = '1.01';
6 |  |  |  |  |
7 | 3 | 207µs | 2 | 315µs | # spent 255µs (196+59) within vars::BEGIN@7 which was called: # once (196µs+59µs) by base::BEGIN@4 at line 7 use warnings::register; # spent 255µs making 1 call to vars::BEGIN@7 # spent 59µs making 1 call to warnings::register::import
8 | 3 | 231µs | 2 | 21µs | # spent 13µs (5+8) within vars::BEGIN@8 which was called: # once (5µs+8µs) by base::BEGIN@4 at line 8 use strict qw(vars subs); # spent 13µs making 1 call to vars::BEGIN@8 # spent 8µs making 1 call to strict::import
9 |  |  |  |  |
10 |  |  |  |  | # spent 3.29ms (2.64+651µs) within vars::import which was called 74 times, avg 44µs/call: # once (159µs+39µs) by Hash::Merge::BEGIN@8 at line 8 of Hash/Merge.pm # once (116µs+26µs) by YAML::Syck::BEGIN@5 at line 5 of YAML/Syck.pm # once (103µs+24µs) by File::stat::BEGIN@28 at line 28 of File/stat.pm # once (69µs+17µs) by Net::SSH::BEGIN@4 at line 4 of Net/SSH.pm # once (58µs+18µs) by DateTime::TimeZone::Catalog::BEGIN@15 at line 15 of DateTime/TimeZone/Catalog.pm # once (60µs+15µs) by File::Slurp::BEGIN@15 at line 15 of File/Slurp.pm # once (60µs+15µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm # once (59µs+13µs) by Data::Compare::BEGIN@12 at line 12 of Data/Compare.pm # once (55µs+11µs) by POSIX::SigRt::BEGIN@66 at line 66 of POSIX.pm # once (50µs+16µs) by Try::Tiny::BEGIN@6 at line 6 of Try/Tiny.pm # once (54µs+11µs) by Math::Round::BEGIN@5 at line 5 of Math/Round.pm # once (51µs+13µs) by Net::SCP::BEGIN@4 at line 4 of Net/SCP.pm # once (52µs+12µs) by File::Spec::Functions::BEGIN@6 at line 6 of File/Spec/Functions.pm # once (50µs+13µs) by File::Temp::BEGIN@166 at line 166 of File/Temp.pm # once (48µs+13µs) by File::Path::BEGIN@19 at line 19 of File/Path.pm # once (50µs+11µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (48µs+12µs) by Time::Local::BEGIN@8 at line 8 of Time/Local.pm # once (46µs+13µs) by Class::Inspector::BEGIN@50 at line 50 of Class/Inspector.pm # once (45µs+11µs) by File::ShareDir::BEGIN@116 at line 116 of File/ShareDir.pm # once (45µs+11µs) by LockFile::Simple::BEGIN@70 at line 70 of LockFile/Simple.pm # once (44µs+11µs) by SQL::Translator::BEGIN@22 at line 22 of SQL/Translator.pm # once (41µs+9µs) by Log::Log4perl::Level::BEGIN@23 at line 23 of Log/Log4perl/Level.pm # once (39µs+11µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (40µs+9µs) by DBD::SQLite::BEGIN@9 at line 9 of DBD/SQLite.pm # once (36µs+11µs) by SQL::Translator::Schema::Index::BEGIN@52 at line 52 of SQL/Translator/Schema/Index.pm # once (35µs+11µs) by SQL::Translator::Schema::Trigger::BEGIN@55 at line 55 of SQL/Translator/Schema/Trigger.pm # once (36µs+9µs) by Params::Validate::BEGIN@15 at line 15 of Params/Validate.pm # once (38µs+7µs) by SQL::Translator::Producer::SQLite::BEGIN@44 at line 44 of SQL/Translator/Producer/SQLite.pm # once (32µs+12µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (33µs+10µs) by DBD::SQLite::BEGIN@8 at line 8 of DBD/SQLite.pm # once (35µs+8µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm # once (32µs+9µs) by SQL::Translator::Schema::Field::BEGIN@49 at line 49 of SQL/Translator/Schema/Field.pm # once (37µs+4µs) by Memoize::BEGIN@27 at line 27 of Memoize.pm # once (34µs+6µs) by Digest::SHA1::BEGIN@4 at line 4 of Digest/SHA1.pm # once (32µs+7µs) by SQL::Translator::Utils::BEGIN@23 at line 23 of SQL/Translator/Utils.pm # once (32µs+7µs) by SQL::Translator::Schema::Constraint::BEGIN@50 at line 50 of SQL/Translator/Schema/Constraint.pm # once (29µs+10µs) by LockFile::Lock::Simple::BEGIN@23 at line 23 of LockFile/Lock/Simple.pm # once (27µs+11µs) by constant::BEGIN@6 at line 6 of constant.pm # once (30µs+7µs) by IO::Select::BEGIN@11 at line 11 of IO/Select.pm # once (30µs+7µs) by SQL::Translator::Schema::View::BEGIN@49 at line 49 of SQL/Translator/Schema/View.pm # once (27µs+7µs) by Hash::Merge::Simple::BEGIN@10 at line 10 of Hash/Merge/Simple.pm # once (29µs+6µs) by String::ShellQuote::BEGIN@29 at line 29 of String/ShellQuote.pm # once (28µs+6µs) by String::Escape::BEGIN@364 at line 364 of String/Escape.pm # once (28µs+5µs) by DateTime::Format::Builder::Parser::Strptime::BEGIN@28 at line 28 of DateTime/Format/Builder/Parser/Strptime.pm # once (26µs+6µs) by Kwalify::BEGIN@19 at line 19 of Kwalify.pm # once (22µs+9µs) by SQL::Translator::Producer::BEGIN@22 at line 22 of SQL/Translator/Producer.pm # once (25µs+6µs) by DateTime::Format::Builder::Parser::Dispatch::BEGIN@3 at line 3 of DateTime/Format/Builder/Parser/Dispatch.pm # once (25µs+4µs) by String::Escape::BEGIN@57 at line 57 of String/Escape.pm # once (24µs+5µs) by DateTime::Format::Builder::Parser::Regex::BEGIN@69 at line 69 of DateTime/Format/Builder/Parser/Regex.pm # once (20µs+8µs) by namespace::clean::BEGIN@6 at line 6 of namespace/clean.pm # once (22µs+5µs) by SQL::Translator::Schema::Constants::BEGIN@62 at line 62 of SQL/Translator/Schema/Constants.pm # once (21µs+6µs) by Test::MockModule::BEGIN@4 at line 4 of Test/MockModule.pm # once (21µs+7µs) by Class::Data::Inheritable::BEGIN@4 at line 4 of Class/Data/Inheritable.pm # once (19µs+8µs) by DateTime::Format::SQLite::BEGIN@6 at line 6 of DateTime/Format/SQLite.pm # once (22µs+5µs) by DateTime::Format::Builder::BEGIN@17 at line 17 of DateTime/Format/Builder.pm # once (22µs+5µs) by DateTime::Format::Builder::Parser::Quick::BEGIN@3 at line 3 of DateTime/Format/Builder/Parser/Quick.pm # once (22µs+5µs) by String::Escape::BEGIN@182 at line 182 of String/Escape.pm # once (20µs+5µs) by Class::MakeMethods::Utility::Ref::BEGIN@41 at line 41 of Class/MakeMethods/Utility/Ref.pm # once (21µs+4µs) by String::Escape::BEGIN@255 at line 255 of String/Escape.pm # once (17µs+8µs) by base::BEGIN@4 at line 4 of base.pm # once (19µs+6µs) by Class::Factory::Util::BEGIN@4 at line 4 of Class/Factory/Util.pm # once (19µs+3µs) by parent::BEGIN@3 at line 3 of parent.pm # once (17µs+5µs) by String::Escape::BEGIN@13 at line 13 of String/Escape.pm # once (16µs+2µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm # once (16µs+2µs) by DBD::SQLite::BEGIN@10 at line 10 of DBD/SQLite.pm # once (15µs+3µs) by Class::MakeMethods::Utility::Ref::BEGIN@96 at line 96 of Class/MakeMethods/Utility/Ref.pm # once (14µs+3µs) by DateTime::Format::Builder::Parser::BEGIN@3 at line 3 of DateTime/Format/Builder/Parser.pm # once (13µs+3µs) by SQL::Translator::Schema::BEGIN@57 at line 57 of SQL/Translator/Schema.pm # once (13µs+3µs) by DateTime::Format::Builder::Parser::generic::BEGIN@3 at line 3 of DateTime/Format/Builder/Parser/generic.pm # once (13µs+3µs) by String::Escape::BEGIN@516 at line 516 of String/Escape.pm # once (13µs+3µs) by SQL::Translator::Schema::Table::BEGIN@50 at line 50 of SQL/Translator/Schema/Table.pm # once (13µs+3µs) by SQL::Translator::Schema::Procedure::BEGIN@53 at line 53 of SQL/Translator/Schema/Procedure.pm # once (13µs+3µs) by SQL::Translator::Schema::Object::BEGIN@42 at line 42 of SQL/Translator/Schema/Object.pm # once (13µs+2µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm sub import {
11 | 1176 | 3.46ms |  |  | my $callpack = caller;
12 |  |  |  |  | my ($pack, @imports) = @_;
13 |  |  |  |  | my ($sym, $ch);
14 |  |  |  |  | foreach (@imports) {
15 |  |  | 220 | 436µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 436µs making 220 calls to vars::CORE:match, avg 2µs/call
16 |  |  | 220 | 106µs | if ($sym =~ /\W/) { # spent 106µs making 220 calls to vars::CORE:match, avg 483ns/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 |  |  | 220 | 109µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 109µs making 220 calls to vars::CORE:match, avg 495ns/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 |  |  |  |  |
46 | 1 | 2µs |  |  | 1;
47 |  |  |  |  | __END__
|  |  |  |  | # spent 651µs within vars::CORE:match which was called 660 times, avg 986ns/call: # 220 times (436µs+0s) by vars::import at line 15, avg 2µs/call # 220 times (109µs+0s) by vars::import at line 28, avg 495ns/call # 220 times (106µs+0s) by vars::import at line 16, avg 483ns/call sub vars::CORE:match; # opcode