← Index
NYTProf Performance Profile   « line view »
For webmerge/scripts/webmerge.pl
  Run on Mon Oct 7 02:42:42 2013
Reported on Mon Oct 7 03:03:27 2013

Filename/usr/lib64/perl5/vendor_perl/5.16.0/XML/SAX/Exception.pm
StatementsExecuted 14 statements in 2.84ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11158µs58µsXML::SAX::Exception::::BEGIN@2XML::SAX::Exception::BEGIN@2
11155µs314µsXML::SAX::Exception::::BEGIN@13XML::SAX::Exception::BEGIN@13
11152µs204µsXML::SAX::Exception::::BEGIN@11XML::SAX::Exception::BEGIN@11
11152µs268µsXML::SAX::Exception::::BEGIN@8XML::SAX::Exception::BEGIN@8
11149µs142µsXML::SAX::Exception::::BEGIN@6XML::SAX::Exception::BEGIN@6
0000s0sXML::SAX::Exception::::newXML::SAX::Exception::new
0000s0sXML::SAX::Exception::::stackstringXML::SAX::Exception::stackstring
0000s0sXML::SAX::Exception::::stacktraceXML::SAX::Exception::stacktrace
0000s0sXML::SAX::Exception::::stringifyXML::SAX::Exception::stringify
0000s0sXML::SAX::Exception::::throwXML::SAX::Exception::throw
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package XML::SAX::Exception;
2
# spent 58µs within XML::SAX::Exception::BEGIN@2 which was called: # once (58µs+0s) by XML::SAX::ParserFactory::BEGIN@12 at line 4
BEGIN {
3136µs $XML::SAX::Exception::VERSION = '1.08';
41114µs158µs}
# spent 58µs making 1 call to XML::SAX::Exception::BEGIN@2
5
62169µs2236µs
# spent 142µs (49+94) within XML::SAX::Exception::BEGIN@6 which was called: # once (49µs+94µs) by XML::SAX::ParserFactory::BEGIN@12 at line 6
use strict;
# spent 142µs making 1 call to XML::SAX::Exception::BEGIN@6 # spent 94µs making 1 call to strict::import
7
8135µs1217µs
# spent 268µs (52+217) within XML::SAX::Exception::BEGIN@8 which was called: # once (52µs+217µs) by XML::SAX::ParserFactory::BEGIN@12 at line 9
use overload '""' => "stringify",
# spent 217µs making 1 call to overload::import
91127µs1268µs 'fallback' => 1;
# spent 268µs making 1 call to XML::SAX::Exception::BEGIN@8
10
112151µs2356µs
# spent 204µs (52+152) within XML::SAX::Exception::BEGIN@11 which was called: # once (52µs+152µs) by XML::SAX::ParserFactory::BEGIN@12 at line 11
use vars qw($StackTrace);
# spent 204µs making 1 call to XML::SAX::Exception::BEGIN@11 # spent 152µs making 1 call to vars::import
12
1322.10ms2573µs
# spent 314µs (55+259) within XML::SAX::Exception::BEGIN@13 which was called: # once (55µs+259µs) by XML::SAX::ParserFactory::BEGIN@12 at line 13
use Carp;
# spent 314µs making 1 call to XML::SAX::Exception::BEGIN@13 # spent 259µs making 1 call to Exporter::import
14
1517µs$StackTrace = $ENV{XML_DEBUG} || 0;
16
17# Other exception classes:
18
19139µs@XML::SAX::Exception::NotRecognized::ISA = ('XML::SAX::Exception');
20121µs@XML::SAX::Exception::NotSupported::ISA = ('XML::SAX::Exception');
21119µs@XML::SAX::Exception::Parse::ISA = ('XML::SAX::Exception');
22
23
24sub throw {
25 my $class = shift;
26 if (ref($class)) {
27 die $class;
28 }
29 die $class->new(@_);
30}
31
32sub new {
33 my $class = shift;
34 my %opts = @_;
35 confess "Invalid options: " . join(', ', keys %opts) unless exists $opts{Message};
36
37 bless { ($StackTrace ? (StackTrace => stacktrace()) : ()), %opts },
38 $class;
39}
40
41sub stringify {
42 my $self = shift;
43 local $^W;
44 my $error;
45 if (exists $self->{LineNumber}) {
46 $error = $self->{Message} . " [Ln: " . $self->{LineNumber} .
47 ", Col: " . $self->{ColumnNumber} . "]";
48 }
49 else {
50 $error = $self->{Message};
51 }
52 if ($StackTrace) {
53 $error .= stackstring($self->{StackTrace});
54 }
55 $error .= "\n";
56 return $error;
57}
58
59sub stacktrace {
60 my $i = 2;
61 my @fulltrace;
62 while (my @trace = caller($i++)) {
63 my %hash;
64 @hash{qw(Package Filename Line)} = @trace[0..2];
65 push @fulltrace, \%hash;
66 }
67 return \@fulltrace;
68}
69
70sub stackstring {
71 my $stacktrace = shift;
72 my $string = "\nFrom:\n";
73 foreach my $current (@$stacktrace) {
74 $string .= $current->{Filename} . " Line: " . $current->{Line} . "\n";
75 }
76 return $string;
77}
78
79122µs1;
80
81__END__