← Index
NYTProf Performance Profile   « block view • line view • sub view »
For t/app_dpath.t
  Run on Tue Jun 5 15:25:28 2012
Reported on Tue Jun 5 15:26:02 2012

Filename/home/ss5/local/projects/app-dpath/t/app_dpath.t
StatementsExecuted 254 statements in 11.3s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
181110.1s10.1smain::::CORE:backtick main::CORE:backtick (opcode)
2211.10s1.10smain::::CORE:system main::CORE:system (opcode)
11126.9ms97.7msmain::::BEGIN@11 main::BEGIN@11
11123.6ms41.9msmain::::BEGIN@6 main::BEGIN@6
11118.2ms71.3msmain::::BEGIN@7 main::BEGIN@7
11114.7ms34.1msmain::::BEGIN@13 main::BEGIN@13
11111.7ms26.7msmain::::BEGIN@8 main::BEGIN@8
1119.59ms9.74msmain::::BEGIN@4 main::BEGIN@4
1118.26ms46.5msmain::::BEGIN@9 main::BEGIN@9
181816.26ms10.3smain::::check main::check
1114.89ms7.25msmain::::BEGIN@10 main::BEGIN@10
1114.15ms4.42msmain::::BEGIN@12 main::BEGIN@12
1111.56ms1.75msmain::::BEGIN@3 main::BEGIN@3
13622632µs632µsUNIVERSAL::::isaUNIVERSAL::isa (xsub)
1822233µs233µsUNIVERSAL::::canUNIVERSAL::can (xsub)
11154µs54µsUNIVERSAL::::VERSIONUNIVERSAL::VERSION (xsub)
11139µs39µsversion::::(bool version::(bool (xsub)
41127µs27µsmro::::method_changed_in mro::method_changed_in (xsub)
11122µs22µsversion::::(cmp version::(cmp (xsub)
41118µs18µsutf8::::is_utf8 utf8::is_utf8 (xsub)
41115µs15µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
0000s0smain::::RUNTIME main::RUNTIME
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
01339µsProfile data that couldn't be associated with a specific line:
# spent 339µs making 1 call to Test::Builder::END
1188µs#! /usr/bin/env perl
2
321.40ms21.78ms
# spent 1.75ms (1.56+198µs) within main::BEGIN@3 which was called: # once (1.56ms+198µs) by main::RUNTIME at line 3
use strict;
# spent 1.75ms making 1 call to main::BEGIN@3 # spent 26µs making 1 call to strict::import
429.19ms29.78ms
# spent 9.74ms (9.59+143µs) within main::BEGIN@4 which was called: # once (9.59ms+143µs) by main::RUNTIME at line 4
use warnings;
# spent 9.74ms making 1 call to main::BEGIN@4 # spent 43µs making 1 call to warnings::import
5
62641µs242.0ms
# spent 41.9ms (23.6+18.3) within main::BEGIN@6 which was called: # once (23.6ms+18.3ms) by main::RUNTIME at line 6
use Data::Dumper;
# spent 41.9ms making 1 call to main::BEGIN@6 # spent 144µs making 1 call to Exporter::import
72566µs279.3ms
# spent 71.3ms (18.2+53.1) within main::BEGIN@7 which was called: # once (18.2ms+53.1ms) by main::RUNTIME at line 7
use Test::More;
# spent 71.3ms making 1 call to main::BEGIN@7 # spent 8.03ms making 1 call to Test::Builder::Module::import
82448µs227.5ms
# spent 26.7ms (11.7+15.0) within main::BEGIN@8 which was called: # once (11.7ms+15.0ms) by main::RUNTIME at line 8
use Test::Deep;
# spent 26.7ms making 1 call to main::BEGIN@8 # spent 864µs making 1 call to Exporter::import
92473µs247.0ms
# spent 46.5ms (8.26+38.2) within main::BEGIN@9 which was called: # once (8.26ms+38.2ms) by main::RUNTIME at line 9
use JSON;
# spent 46.5ms making 1 call to main::BEGIN@9 # spent 491µs making 1 call to JSON::import
102545µs27.46ms
# spent 7.25ms (4.89+2.37) within main::BEGIN@10 which was called: # once (4.89ms+2.37ms) by main::RUNTIME at line 10
use YAML::Syck;
# spent 7.25ms making 1 call to main::BEGIN@10 # spent 211µs making 1 call to Exporter::import
112525µs297.8ms
# spent 97.7ms (26.9+70.8) within main::BEGIN@11 which was called: # once (26.9ms+70.8ms) by main::RUNTIME at line 11
use Config::General;
# spent 97.7ms making 1 call to main::BEGIN@11 # spent 118µs making 1 call to Exporter::import
122447µs14.42ms
# spent 4.42ms (4.15+269µs) within main::BEGIN@12 which was called: # once (4.15ms+269µs) by main::RUNTIME at line 12
use Config::INI::Serializer;
# spent 4.42ms making 1 call to main::BEGIN@12
1323.28ms234.3ms
# spent 34.1ms (14.7+19.4) within main::BEGIN@13 which was called: # once (14.7ms+19.4ms) by main::RUNTIME at line 13
use Data::Structure::Util 'unbless';
# spent 34.1ms making 1 call to main::BEGIN@13 # spent 271µs making 1 call to Exporter::import
14
15
# spent 10.3s (6.26ms+10.3) within main::check which was called 18 times, avg 573ms/call: # once (203µs+883ms) by main::RUNTIME at line 63 # once (582µs+870ms) by main::RUNTIME at line 57 # once (365µs+644ms) by main::RUNTIME at line 53 # once (376µs+603ms) by main::RUNTIME at line 75 # once (347µs+602ms) by main::RUNTIME at line 73 # once (362µs+600ms) by main::RUNTIME at line 74 # once (368µs+598ms) by main::RUNTIME at line 72 # once (601µs+579ms) by main::RUNTIME at line 60 # once (480µs+566ms) by main::RUNTIME at line 54 # once (191µs+511ms) by main::RUNTIME at line 68 # once (195µs+505ms) by main::RUNTIME at line 70 # once (191µs+505ms) by main::RUNTIME at line 69 # once (197µs+501ms) by main::RUNTIME at line 67 # once (195µs+483ms) by main::RUNTIME at line 59 # once (285µs+478ms) by main::RUNTIME at line 62 # once (604µs+474ms) by main::RUNTIME at line 55 # once (504µs+464ms) by main::RUNTIME at line 58 # once (213µs+450ms) by main::RUNTIME at line 64
sub check {
1618010.1s my ($intype, $outtype, $path, $expected, $just_diag) = @_;
17
18 $path ||= '//lines//description[ value =~ m(use Data::DPath) ]/../_children//data//name[ value eq "Hash two"]/../value';
19 $expected ||= [ "2" ];
20 my $program = "$^X -Ilib bin/dpath";
21 #my $unblessed = $outtype eq "json" ? "_unblessed" : "";
22 my $infile = "t/testdata.$intype";
23 my $cmd = "$program -i $intype -o $outtype '$path' $infile";
24 #diag $cmd;
251810.1s my $output = `$cmd`;
# spent 10.1s making 18 calls to main::CORE:backtick, avg 564ms/call
26
27 my $result;
2841.13ms293.89ms if ($outtype eq "json")
# spent 1.41ms making 6 calls to JSON::from_json, avg 235µs/call # spent 969µs making 3 calls to Config::INI::Serializer::deserialize, avg 323µs/call # spent 677µs making 6 calls to Data::Structure::Util::unbless, avg 113µs/call # spent 458µs making 5 calls to YAML::Syck::Load, avg 92µs/call # spent 317µs making 3 calls to Config::INI::Serializer::new, avg 106µs/call # spent 59µs making 6 calls to JSON::XS::DESTROY, avg 10µs/call
29 {
30 $result = JSON::from_json(unbless $output);
31 }
32 elsif ($outtype eq "yaml") {
33 $result = YAML::Syck::Load($output);
34 }
35 elsif ($outtype eq "cfggeneral") {
36 my %data = Config::General->new(-String => $output)->getall;
37 $result = \%data;
38 }
39 elsif ($outtype eq "dumper")
40 {
41 eval "\$result = my $output";
# spent 52µs executing statements in 2 string evals (merged) # spent 24µs executing statements in string eval # spent 23µs executing statements in string eval
42 }
43 elsif ($outtype eq "ini") {
44 $result = Config::INI::Serializer->new->deserialize($output);
45 }
4618723µs if ($just_diag) {
47 diag Dumper($result);
48 } else {
4918165ms cmp_deeply $result, $expected, "$intype - dpath - $outtype";
# spent 165ms making 18 calls to Test::Deep::cmp_deeply, avg 9.19ms/call
50 }
51}
52
53126µs1645mscheck (qw(yaml json));
# spent 645ms making 1 call to main::check
54116µs1566mscheck (qw(yaml dumper));
# spent 566ms making 1 call to main::check
55116µs1475mscheck (qw(json dumper));
# spent 475ms making 1 call to main::check
56# XML <-> data mapping is somewhat artificial, so another path is needed
57119µs1870mscheck (qw(xml dumper), '//description[ value =~ m(use Data::DPath) ]/../_children//data//Hash two/value');
# spent 870ms making 1 call to main::check
58129µs1464mscheck (qw(ini dumper), '//description[ value =~ m(use Data::DPath) ]/../number', [ "1" ]);
# spent 464ms making 1 call to main::check
59116µs1483mscheck (qw(ini json), '//description[ value =~ m(use Data::DPath) ]/../number', [ "1" ]);
# spent 483ms making 1 call to main::check
60116µs1579mscheck (qw(ini yaml), '//description[ value =~ m(use Data::DPath) ]/../number', [ "1" ]);
# spent 579ms making 1 call to main::check
61# Config::INI::Serializer hashifies arrays - array indexes become hashkeys
62125µs1479mscheck (qw(ini ini), '//description[ value =~ m(use Data::DPath) ]/../number', { '0' => "1" });
# spent 479ms making 1 call to main::check
63119µs1883mscheck (qw(xml ini), '//description[ value =~ m(use Data::DPath) ]/../number', { '0' => "1" });
# spent 883ms making 1 call to main::check
64119µs1451mscheck (qw(ini ini), '/start_time', { '0' => "1236463400.25151" });
# spent 451ms making 1 call to main::check
65
66# Config::General is also somewhat special
67117µs1501mscheck (qw(cfggeneral json), '/etc/base', [ "/usr" ]);
# spent 501ms making 1 call to main::check
68116µs1511mscheck (qw(cfggeneral json), '//home', [ "/usr/home/max" ]);
# spent 511ms making 1 call to main::check
69116µs1505mscheck (qw(cfggeneral json), '//mono//bl', [ 2 ]);
# spent 505ms making 1 call to main::check
70117µs1505mscheck (qw(cfggeneral json), '//log', [ "/usr/log/logfile" ]);
# spent 505ms making 1 call to main::check
71
72117µs1598mscheck (qw(cfggeneral yaml), '/etc/base', [ "/usr" ]);
# spent 598ms making 1 call to main::check
73117µs1603mscheck (qw(cfggeneral yaml), '//home', [ "/usr/home/max" ]);
# spent 603ms making 1 call to main::check
74120µs1600mscheck (qw(cfggeneral yaml), '//mono//bl', [ 2 ]);
# spent 600ms making 1 call to main::check
75126µs1603mscheck (qw(cfggeneral yaml), '//log', [ "/usr/log/logfile" ]);
# spent 603ms making 1 call to main::check
76
77136µs1847µsdiag qq{Ignore "unsupported innermost nesting" errors, that is what we test...};
# spent 847µs making 1 call to Test::More::diag
78
7911µsmy $program;
801600nsmy $infile;
811600nsmy $path;
821900nsmy $ret;
83
8416µs$program = "$^X -Ilib bin/dpath";
8512µs$infile = "t/flatabledata.yaml";
86
8712µs$path = "//UnsupportedInnermostHash";
881557ms1557ms$ret = system("$program -o flat '$path' $infile");
# spent 557ms making 1 call to main::CORE:system
89160µs12.52msisnt ($ret, 0, "deny unsupported innermost HASH");
# spent 2.52ms making 1 call to Test::More::isnt
90
9113µs$path = "//UnsupportedInnermostArray";
921543ms1542ms$ret = system("$program -o flat '$path' $infile");
# spent 542ms making 1 call to main::CORE:system
93172µs12.49msisnt ($ret, 0, "deny unsupported innermost ARRAY");
# spent 2.49ms making 1 call to Test::More::isnt
94
95120µs1548µsdone_testing;
# spent 548µs making 1 call to Test::More::done_testing
 
# spent 15µs within Internals::SvREADONLY which was called 4 times, avg 4µs/call: # 4 times (15µs+0s) by constant::import at line 132 of constant.pm, avg 4µs/call
sub Internals::SvREADONLY; # xsub
# spent 54µs within UNIVERSAL::VERSION which was called: # once (54µs+0s) by JSON::BEGIN@2 at line 2 of (eval 11)[JSON.pm:252]
sub UNIVERSAL::VERSION; # xsub
# spent 233µs within UNIVERSAL::can which was called 18 times, avg 13µs/call: # 17 times (213µs+0s) by Config::General::BEGIN@21 at line 41 of File/Spec/Functions.pm, avg 13µs/call # once (20µs+0s) by attributes::import at line 50 of attributes.pm
sub UNIVERSAL::can; # xsub
# spent 632µs within UNIVERSAL::isa which was called 136 times, avg 5µs/call: # 126 times (549µs+0s) by Test::Deep::wrap at line 346 of Test/Deep.pm, avg 4µs/call # 10 times (84µs+0s) by base::import at line 74 of base.pm, avg 8µs/call
sub UNIVERSAL::isa; # xsub
# spent 10.1s within main::CORE:backtick which was called 18 times, avg 564ms/call: # 18 times (10.1s+0s) by main::check at line 25, avg 564ms/call
sub main::CORE:backtick; # opcode
# spent 1.10s within main::CORE:system which was called 2 times, avg 550ms/call: # once (557ms+0s) by main::RUNTIME at line 88 # once (542ms+0s) by main::RUNTIME at line 92
sub main::CORE:system; # opcode
# spent 27µs within mro::method_changed_in which was called 4 times, avg 7µs/call: # 4 times (27µs+0s) by constant::import at line 147 of constant.pm, avg 7µs/call
sub mro::method_changed_in; # xsub
# spent 18µs within utf8::is_utf8 which was called 4 times, avg 4µs/call: # 4 times (18µs+0s) by constant::import at line 123 of constant.pm, avg 4µs/call
sub utf8::is_utf8; # xsub
# spent 39µs within version::(bool which was called: # once (39µs+0s) by Test::Builder::BEGIN@19 at line 57 of Config.pm
sub version::(bool; # xsub
# spent 22µs within version::(cmp which was called: # once (22µs+0s) by Test::Builder::BEGIN@19 at line 60 of Config.pm
sub version::(cmp; # xsub