← 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/x86_64-linux/XML/LibXML/SAX.pm
StatementsExecuted 58 statements in 6.05ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11197.0ms97.3msXML::LibXML::SAX::::BEGIN@18XML::LibXML::SAX::BEGIN@18
11160.9ms203msXML::LibXML::SAX::::BEGIN@17XML::LibXML::SAX::BEGIN@17
211324µs134msXML::LibXML::SAX::::_parse_stringXML::LibXML::SAX::_parse_string
211247µs133msXML::LibXML::SAX::::_parseXML::LibXML::SAX::_parse
211159µs541µsXML::LibXML::SAX::::set_featureXML::LibXML::SAX::set_feature
11181µs180µsXML::LibXML::SAX::::BEGIN@12XML::LibXML::SAX::BEGIN@12
11170µs1.08msXML::LibXML::SAX::::BEGIN@23XML::LibXML::SAX::BEGIN@23
11163µs647µsXML::LibXML::SAX::::BEGIN@20XML::LibXML::SAX::BEGIN@20
11160µs324µsXML::LibXML::SAX::::BEGIN@22XML::LibXML::SAX::BEGIN@22
11154µs286µsXML::LibXML::SAX::::BEGIN@13XML::LibXML::SAX::BEGIN@13
0000s0sXML::LibXML::SAX::::CLONE_SKIPXML::LibXML::SAX::CLONE_SKIP
0000s0sXML::LibXML::SAX::::_parse_bytestreamXML::LibXML::SAX::_parse_bytestream
0000s0sXML::LibXML::SAX::::_parse_characterstreamXML::LibXML::SAX::_parse_characterstream
0000s0sXML::LibXML::SAX::::_parse_systemidXML::LibXML::SAX::_parse_systemid
0000s0sXML::LibXML::SAX::::parse_chunkXML::LibXML::SAX::parse_chunk
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# $Id$
2#
3# This is free software, you may use it and distribute it under the same terms as
4# Perl itself.
5#
6# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
7#
8#
9
10package XML::LibXML::SAX;
11
122241µs2278µs
# spent 180µs (81+98) within XML::LibXML::SAX::BEGIN@12 which was called: # once (81µs+98µs) by XML::SAX::ParserFactory::parser at line 12
use strict;
# spent 180µs making 1 call to XML::LibXML::SAX::BEGIN@12 # spent 98µs making 1 call to strict::import
132207µs2519µs
# spent 286µs (54+233) within XML::LibXML::SAX::BEGIN@13 which was called: # once (54µs+233µs) by XML::SAX::ParserFactory::parser at line 13
use vars qw($VERSION @ISA);
# spent 286µs making 1 call to XML::LibXML::SAX::BEGIN@13 # spent 233µs making 1 call to vars::import
14
1514µs$VERSION = "1.90"; # VERSION TEMPLATE: DO NOT CHANGE
16
172646µs2204ms
# spent 203ms (60.9+142) within XML::LibXML::SAX::BEGIN@17 which was called: # once (60.9ms+142ms) by XML::SAX::ParserFactory::parser at line 17
use XML::LibXML;
# spent 203ms making 1 call to XML::LibXML::SAX::BEGIN@17 # spent 1.17ms making 1 call to XML::LibXML::import
182892µs197.3ms
# spent 97.3ms (97.0+267µs) within XML::LibXML::SAX::BEGIN@18 which was called: # once (97.0ms+267µs) by XML::SAX::ParserFactory::parser at line 18
use XML::SAX::Base;
# spent 97.3ms making 1 call to XML::LibXML::SAX::BEGIN@18
19
202186µs21.23ms
# spent 647µs (63+584) within XML::LibXML::SAX::BEGIN@20 which was called: # once (63µs+584µs) by XML::SAX::ParserFactory::parser at line 20
use base qw(XML::SAX::Base);
# spent 647µs making 1 call to XML::LibXML::SAX::BEGIN@20 # spent 584µs making 1 call to base::import
21
222166µs2588µs
# spent 324µs (60+264) within XML::LibXML::SAX::BEGIN@22 which was called: # once (60µs+264µs) by XML::SAX::ParserFactory::parser at line 22
use Carp;
# spent 324µs making 1 call to XML::LibXML::SAX::BEGIN@22 # spent 264µs making 1 call to Exporter::import
2323.03ms22.09ms
# spent 1.08ms (70µs+1.01) within XML::LibXML::SAX::BEGIN@23 which was called: # once (70µs+1.01ms) by XML::SAX::ParserFactory::parser at line 23
use IO::File;
# spent 1.08ms making 1 call to XML::LibXML::SAX::BEGIN@23 # spent 1.01ms making 1 call to Exporter::import
24
25sub CLONE_SKIP {
26 return $XML::LibXML::__threads_shared ? 0 : 1;
27}
28
29
# spent 541µs (159+382) within XML::LibXML::SAX::set_feature which was called 2 times, avg 271µs/call: # 2 times (159µs+382µs) by XML::SAX::Base::new at line 2592 of XML/SAX/Base.pm, avg 271µs/call
sub set_feature {
30213µs my ($self, $feat, $val) = @_;
31
3226µs if ($feat eq 'http://xmlns.perl.org/sax/join-character-data') {
33 $self->{JOIN_CHARACTERS} = $val;
34 return 1;
35 }
36
3723µs shift(@_);
382140µs2382µs return $self->SUPER::set_feature(@_);
# spent 382µs making 2 calls to XML::SAX::Base::set_feature, avg 191µs/call
39}
40
41sub _parse_characterstream {
42 my ( $self, $fh ) = @_;
43 # this my catch the xml decl, so the parser won't get confused about
44 # a possibly wrong encoding.
45 croak( "not implemented yet" );
46}
47
48sub _parse_bytestream {
49 my ( $self, $fh ) = @_;
50
51 $self->{ParserOptions}{LibParser} = XML::LibXML->new;
52 $self->{ParserOptions}{ParseFunc} = \&XML::LibXML::parse_fh;
53 $self->{ParserOptions}{ParseFuncParam} = $fh;
54 $self->_parse;
55 return $self->end_document({});
56}
57
58
# spent 134ms (324µs+134) within XML::LibXML::SAX::_parse_string which was called 2 times, avg 67.1ms/call: # 2 times (324µs+134ms) by XML::SAX::Base::parse at line 2609 of XML/SAX/Base.pm, avg 67.1ms/call
sub _parse_string {
59232µs my ( $self, $string ) = @_;
60# $self->{ParserOptions}{LibParser} = XML::LibXML->new;
61262µs295µs $self->{ParserOptions}{LibParser} = XML::LibXML->new() unless defined $self->{ParserOptions}{LibParser};
# spent 95µs making 2 calls to XML::LibXML::new, avg 48µs/call
62216µs $self->{ParserOptions}{ParseFunc} = \&XML::LibXML::parse_string;
63264µs $self->{ParserOptions}{ParseFuncParam} = $string;
64230µs2133ms $self->_parse;
# spent 133ms making 2 calls to XML::LibXML::SAX::_parse, avg 66.7ms/call
65287µs2290µs return $self->end_document({});
# spent 290µs making 2 calls to XML::SAX::Base::end_document, avg 145µs/call
66}
67
68sub _parse_systemid {
69 my $self = shift;
70 $self->{ParserOptions}{LibParser} = XML::LibXML->new;
71 $self->{ParserOptions}{ParseFunc} = \&XML::LibXML::parse_file;
72 $self->{ParserOptions}{ParseFuncParam} = shift;
73 $self->_parse;
74 return $self->end_document({});
75}
76
77sub parse_chunk {
78 my ( $self, $chunk ) = @_;
79 $self->{ParserOptions}{LibParser} = XML::LibXML->new;
80 $self->{ParserOptions}{ParseFunc} = \&XML::LibXML::parse_xml_chunk;
81 $self->{ParserOptions}{LibParser}->{IS_FILTER}=1; # a hack to prevent parse_xml_chunk from issuing end_document
82 $self->{ParserOptions}{ParseFuncParam} = $chunk;
83 $self->_parse;
84 return;
85}
86
87
# spent 133ms (247µs+133) within XML::LibXML::SAX::_parse which was called 2 times, avg 66.7ms/call: # 2 times (247µs+133ms) by XML::LibXML::SAX::_parse_string at line 64, avg 66.7ms/call
sub _parse {
8826µs my $self = shift;
89223µs my $args = bless $self->{ParserOptions}, ref($self);
90
91210µs if (defined($self->{JOIN_CHARACTERS})) {
92 $args->{LibParser}->{JOIN_CHARACTERS} = $self->{JOIN_CHARACTERS};
93 } else {
94215µs $args->{LibParser}->{JOIN_CHARACTERS} = 0;
95 }
96
97230µs264µs $args->{LibParser}->set_handler( $self );
# spent 64µs making 2 calls to XML::LibXML::set_handler, avg 32µs/call
9828µs eval {
99234µs2133ms $args->{ParseFunc}->($args->{LibParser}, $args->{ParseFuncParam});
# spent 133ms making 2 calls to XML::LibXML::parse_string, avg 66.6ms/call
100 };
101
102217µs if ( $args->{LibParser}->{SAX}->{State} == 1 ) {
103 croak( "SAX Exception not implemented, yet; Data ended before document ended\n" );
104 }
105
106 # break a possible circular reference
107226µs265µs $args->{LibParser}->set_handler( undef );
# spent 65µs making 2 calls to XML::LibXML::set_handler, avg 32µs/call
10822µs if ( $@ ) {
109 croak $@;
110 }
111236µs return;
112}
113
114116µs1;
115