← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:50 2015

Filename/usr/share/perl5/YAML/Mo.pm
StatementsExecuted 77 statements in 1.89ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1662218µs10.2msYAML::Mo::::__ANON__[:5]YAML::Mo::__ANON__[:5]
11114µs30µsYAML::Mo::::BEGIN@5YAML::Mo::BEGIN@5
1118µs20µsYAML::Mo::::BEGIN@5.5YAML::Mo::BEGIN@5.5
1118µs15µsYAML::Mo::::BEGIN@5.6YAML::Mo::BEGIN@5.6
1116µs16µsYAML::Mo::::BEGIN@11YAML::Mo::BEGIN@11
4114µs4µsYAML::Mo::::CORE:sortYAML::Mo::CORE:sort (opcode)
3112µs2µsYAML::Mo::::CORE:matchYAML::Mo::CORE:match (opcode)
0000s0sYAML::Mo::::__ANON__[:17]YAML::Mo::__ANON__[:17]
0000s0sYAML::Mo::::__ANON__[:25]YAML::Mo::__ANON__[:25]
0000s0sYAML::Mo::::__ANON__[:51]YAML::Mo::__ANON__[:51]
0000s0sYAML::Mo::::__ANON__[:56]YAML::Mo::__ANON__[:56]
0000s0sYAML::Mo::::__ANON__[:65]YAML::Mo::__ANON__[:65]
0000s0sYAML::Mo::::__ANON__[:78]YAML::Mo::__ANON__[:78]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
11600nspackage YAML::Mo; $VERSION = '0.88';
2# use Mo qw[builder default import];
3# The following line of code was produced from the previous line by
4# Mo::Inline version 0.31
565757µs2510.2ms
# spent 15µs (8+7) within YAML::Mo::BEGIN@5.6 which was called: # once (8µs+7µs) by YAML::BEGIN@4 at line 5 # spent 10.2ms (218µs+9.99) within YAML::Mo::__ANON__[/usr/share/perl5/YAML/Mo.pm:5] which was called 16 times, avg 638µs/call: # 11 times (156µs+9.97ms) by YAML::BEGIN@4 or YAML::Mo::__ANON__[/usr/share/perl5/YAML/Mo.pm:5] at line 5, avg 920µs/call # once (18µs+9µs) by C4::Items::BEGIN@33 at line 17 of YAML.pm # once (12µs+5µs) by C4::Items::BEGIN@33 at line 20 of YAML.pm # once (10µs+6µs) by C4::Items::BEGIN@33 at line 18 of YAML.pm # once (12µs+2µs) by YAML::BEGIN@4 at line 4 of YAML.pm # once (9µs+4µs) by C4::Items::BEGIN@33 at line 19 of YAML.pm # spent 20µs (8+12) within YAML::Mo::BEGIN@5.5 which was called: # once (8µs+12µs) by YAML::BEGIN@4 at line 5 # spent 30µs (14+16) within YAML::Mo::BEGIN@5 which was called: # once (14µs+16µs) by YAML::BEGIN@4 at line 5
no warnings;my$M=__PACKAGE__.'::';*{$M.Object::new}=sub{bless{@_[1..$#_]},$_[0]};*{$M.import}=sub{import warnings;$^H|=1538;my($P,%e,%o)=caller.'::';shift;eval"no Mo::$_",&{$M.$_.::e}($P,\%e,\%o,\@_)for@_;return if$e{M};%e=(extends,sub{eval"no $_[0]()";@{$P.ISA}=$_[0]},has,sub{my$n=shift;my$m=sub{$#_?$_[0]{$n}=$_[1]:$_[0]{$n}};$m=$o{$_}->($m,$n,@_)for sort keys%o;*{$P.$n}=$m},%e,);*{$P.$_}=$e{$_}for keys%e;@{$P.ISA}=$M.Object};*{$M.'builder::e'}=sub{my($P,$e,$o)=@_;$o->{builder}=sub{my($m,$n,%a)=@_;my$b=$a{builder}or return$m;sub{$#_?$m->(@_):!exists$_[0]{$n}?$_[0]{$n}=$_[0]->$b:$m->(@_)}}};*{$M.'default::e'}=sub{my($P,$e,$o)=@_;$o->{default}=sub{my($m,$n,%a)=@_;$a{default}or return$m;sub{$#_?$m->(@_):!exists$_[0]{$n}?$_[0]{$n}=$a{default}->(@_):$m->(@_)}}};my$i=\&import;*{$M.import}=sub{(@_==2 and not $_[1])?pop@_:@_==1?push@_,grep!/import/,@f:();goto&$i};@f=qw[builder default import];use strict;use warnings;
# spent 10.1ms making 11 calls to YAML::Mo::__ANON__[YAML/Mo.pm:5], avg 920µs/call # spent 30µs making 1 call to YAML::Mo::BEGIN@5 # spent 20µs making 1 call to YAML::Mo::BEGIN@5.5 # spent 16µs making 1 call to warnings::unimport # spent 15µs making 1 call to YAML::Mo::BEGIN@5.6 # spent 12µs making 1 call to strict::import # spent 12µs making 2 calls to warnings::import, avg 6µs/call # spent 4µs making 4 calls to YAML::Mo::CORE:sort, avg 875ns/call # spent 2µs making 3 calls to YAML::Mo::CORE:match, avg 700ns/call
# spent 8.97ms executing statements in string eval
# includes 8.95ms spent executing 1 call to 1 sub defined therein. # spent 1.01ms executing statements in string eval
# includes 1.00ms spent executing 1 call to 1 sub defined therein.
6
71100nsour $DumperModule = 'Data::Dumper';
8
91100nsmy ($_new_error, $_info, $_scalar_info);
10
1121.11ms225µs
# spent 16µs (6+9) within YAML::Mo::BEGIN@11 which was called: # once (6µs+9µs) by YAML::BEGIN@4 at line 11
no strict 'refs';
# spent 16µs making 1 call to YAML::Mo::BEGIN@11 # spent 9µs making 1 call to strict::unimport
12*{$M.'Object::die'} = sub {
13 my $self = shift;
14 my $error = $self->$_new_error(@_);
15 $error->type('Error');
16 Carp::croak($error->format_message);
1712µs};
18
19*{$M.'Object::warn'} = sub {
20 my $self = shift;
21 return unless $^W;
22 my $error = $self->$_new_error(@_);
23 $error->type('Warning');
24 Carp::cluck($error->format_message);
2512µs};
26
27# This code needs to be refactored to be simpler and more precise, and no,
28# Scalar::Util doesn't DWIM.
29#
30# Can't handle:
31# * blessed regexp
32*{$M.'Object::node_info'} = sub {
33 my $self = shift;
34 my $stringify = $_[1] || 0;
35 my ($class, $type, $id) =
36 ref($_[0])
37 ? $stringify
38 ? &$_info("$_[0]")
39 : do {
40 require overload;
41 my @info = &$_info(overload::StrVal($_[0]));
42 if (ref($_[0]) eq 'Regexp') {
43 @info[0, 1] = (undef, 'REGEXP');
44 }
45 @info;
46 }
47 : &$_scalar_info($_[0]);
48 ($class, $type, $id) = &$_scalar_info("$_[0]")
49 unless $id;
50 return wantarray ? ($class, $type, $id) : $id;
5112µs};
52
53#-------------------------------------------------------------------------------
54$_info = sub {
55 return (($_[0]) =~ qr{^(?:(.*)\=)?([^=]*)\(([^\(]*)\)$}o);
561700ns};
57
58$_scalar_info = sub {
59 my $id = 'undef';
60 if (defined $_[0]) {
61 \$_[0] =~ /\((\w+)\)$/o or CORE::die();
62 $id = "$1-S";
63 }
64 return (undef, undef, $id);
651700ns};
66
67$_new_error = sub {
68 require Carp;
69 my $self = shift;
70 require YAML::Error;
71
72 my $code = shift || 'unknown error';
73 my $error = YAML::Error->new(code => $code);
74 $error->line($self->line) if $self->can('line');
75 $error->document($self->document) if $self->can('document');
76 $error->arguments([@_]);
77 return $error;
781700ns};
79
8017µs1;
 
# spent 2µs within YAML::Mo::CORE:match which was called 3 times, avg 700ns/call: # 3 times (2µs+0s) by YAML::Mo::__ANON__[/usr/share/perl5/YAML/Mo.pm:5] at line 5, avg 700ns/call
sub YAML::Mo::CORE:match; # opcode
# spent 4µs within YAML::Mo::CORE:sort which was called 4 times, avg 875ns/call: # 4 times (4µs+0s) by YAML::Mo::__ANON__[/usr/share/perl5/YAML/Mo.pm:5] at line 5, avg 875ns/call
sub YAML::Mo::CORE:sort; # opcode