← 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:23:05 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/YAML.pm
StatementsExecuted 31 statements in 789µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.04ms1.35msYAML::::BEGIN@12 YAML::BEGIN@12
1111.03ms1.32msYAML::::BEGIN@3 YAML::BEGIN@3
11132µs32µsTapper::MCP::Net::::BEGIN@1Tapper::MCP::Net::BEGIN@1
1119µs62µsYAML::::BEGIN@15 YAML::BEGIN@15
1119µs30µsYAML::::BEGIN@7 YAML::BEGIN@7
1118µs28µsYAML::::BEGIN@38 YAML::BEGIN@38
0000s0sYAML::::Bless YAML::Bless
0000s0sYAML::::Blessed YAML::Blessed
0000s0sYAML::::Dump YAML::Dump
0000s0sYAML::::DumpFile YAML::DumpFile
0000s0sYAML::::Load YAML::Load
0000s0sYAML::::LoadFile YAML::LoadFile
0000s0sYAML::::__ANON__[:18] YAML::__ANON__[:18]
0000s0sYAML::::__ANON__[:19] YAML::__ANON__[:19]
0000s0sYAML::::__ANON__[:20] YAML::__ANON__[:20]
0000s0sYAML::::__ANON__[:21] YAML::__ANON__[:21]
0000s0sYAML::::global_object YAML::global_object
0000s0sYAML::::init_action_object YAML::init_action_object
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1345µs132µs
# spent 32µs within Tapper::MCP::Net::BEGIN@1 which was called: # once (32µs+0s) by Tapper::MCP::Net::BEGIN@16 at line 1
use 5.008001;
# spent 32µs making 1 call to Tapper::MCP::Net::BEGIN@1
2package YAML;
33101µs21.33ms
# spent 1.32ms (1.03+290µs) within YAML::BEGIN@3 which was called: # once (1.03ms+290µs) by Tapper::MCP::Net::BEGIN@16 at line 3
use YAML::Mo;
# spent 1.32ms making 1 call to YAML::BEGIN@3 # spent 17µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
4
51800nsour $VERSION = '0.81';
6
7342µs251µs
# spent 30µs (9+21) within YAML::BEGIN@7 which was called: # once (9µs+21µs) by Tapper::MCP::Net::BEGIN@16 at line 7
use Exporter;
# spent 30µs making 1 call to YAML::BEGIN@7 # spent 21µs making 1 call to Exporter::import
816µspush @YAML::ISA, 'Exporter';
911µsour @EXPORT = qw{ Dump Load };
1012µsour @EXPORT_OK = qw{ freeze thaw DumpFile LoadFile Bless Blessed };
11
12381µs21.38ms
# spent 1.35ms (1.04+314µs) within YAML::BEGIN@12 which was called: # once (1.04ms+314µs) by Tapper::MCP::Net::BEGIN@16 at line 12
use YAML::Node; # XXX This is a temp fix for Module::Build
# spent 1.35ms making 1 call to YAML::BEGIN@12 # spent 25µs making 1 call to Exporter::import
13
14# XXX This VALUE nonsense needs to go.
153155µs2114µs
# spent 62µs (9+53) within YAML::BEGIN@15 which was called: # once (9µs+53µs) by Tapper::MCP::Net::BEGIN@16 at line 15
use constant VALUE => "\x07YAML\x07VALUE\x07";
# spent 62µs making 1 call to YAML::BEGIN@15 # spent 52µs making 1 call to constant::import
16
17# YAML Object Properties
1813µs137µshas dumper_class => default => sub {'YAML::Dumper'};
# spent 37µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
1912µs126µshas loader_class => default => sub {'YAML::Loader'};
# spent 26µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
2012µs118µshas dumper_object => default => sub {$_[0]->init_action_object("dumper")};
# spent 18µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
2112µs121µshas loader_object => default => sub {$_[0]->init_action_object("loader")};
# spent 21µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
22
23sub Dump {
24 my $yaml = YAML->new;
25 $yaml->dumper_class($YAML::DumperClass)
26 if $YAML::DumperClass;
27 return $yaml->dumper_object->dump(@_);
28}
29
30sub Load {
31 my $yaml = YAML->new;
32 $yaml->loader_class($YAML::LoaderClass)
33 if $YAML::LoaderClass;
34 return $yaml->loader_object->load(@_);
35}
36
37{
384335µs249µs
# spent 28µs (8+20) within YAML::BEGIN@38 which was called: # once (8µs+20µs) by Tapper::MCP::Net::BEGIN@16 at line 38
no warnings 'once';
# spent 28µs making 1 call to YAML::BEGIN@38 # spent 20µs making 1 call to warnings::unimport
39 # freeze/thaw is the API for Storable string serialization. Some
40 # modules make use of serializing packages on if they use freeze/thaw.
4121µs *freeze = \ &Dump;
42 *thaw = \ &Load;
43}
44
45sub DumpFile {
46 my $OUT;
47 my $filename = shift;
48 if (ref $filename eq 'GLOB') {
49 $OUT = $filename;
50 }
51 else {
52 my $mode = '>';
53 if ($filename =~ /^\s*(>{1,2})\s*(.*)$/) {
54 ($mode, $filename) = ($1, $2);
55 }
56 open $OUT, $mode, $filename
57 or YAML::Mo::Object->die('YAML_DUMP_ERR_FILE_OUTPUT', $filename, $!);
58 }
59 binmode $OUT, ':utf8'; # if $Config{useperlio} eq 'define';
60 local $/ = "\n"; # reset special to "sane"
61 print $OUT Dump(@_);
62}
63
64sub LoadFile {
65 my $IN;
66 my $filename = shift;
67 if (ref $filename eq 'GLOB') {
68 $IN = $filename;
69 }
70 else {
71 open $IN, '<', $filename
72 or YAML::Mo::Object->die('YAML_LOAD_ERR_FILE_INPUT', $filename, $!);
73 }
74 binmode $IN, ':utf8'; # if $Config{useperlio} eq 'define';
75 return Load(do { local $/; <$IN> });
76}
77
78sub init_action_object {
79 my $self = shift;
80 my $object_class = (shift) . '_class';
81 my $module_name = $self->$object_class;
82 eval "require $module_name";
83 $self->die("Error in require $module_name - $@")
84 if $@ and "$@" !~ /Can't locate/;
85 my $object = $self->$object_class->new;
86 $object->set_global_options;
87 return $object;
88}
89
901400nsmy $global = {};
91sub Bless {
92 require YAML::Dumper::Base;
93 YAML::Dumper::Base::bless($global, @_)
94}
95sub Blessed {
96 require YAML::Dumper::Base;
97 YAML::Dumper::Base::blessed($global, @_)
98}
99sub global_object { $global }
100
101111µs1;
102
103__END__