Filename | /usr/lib/perl5/XML/LibXML/SAX/Parser.pm |
Statements | Executed 73176 statements in 335ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1619 | 1 | 1 | 189ms | 529ms | process_element (recurses: max depth 7, inclusive time 818ms) | XML::LibXML::SAX::Parser::
4833 | 3 | 1 | 62.0ms | 531ms | process_node (recurses: max depth 8, inclusive time 1.48s) | XML::LibXML::SAX::Parser::
1 | 1 | 1 | 17.7ms | 17.8ms | BEGIN@17 | XML::LibXML::SAX::Parser::
1 | 1 | 1 | 11.9ms | 29.0ms | BEGIN@15 | XML::LibXML::SAX::Parser::
28 | 2 | 1 | 3.67ms | 542ms | generate | XML::LibXML::SAX::Parser::
1 | 1 | 1 | 2.13ms | 5.38ms | BEGIN@16 | XML::LibXML::SAX::Parser::
25 | 1 | 1 | 1.08ms | 467ms | _parse_string | XML::LibXML::SAX::Parser::
1 | 1 | 1 | 754µs | 785µs | BEGIN@18 | XML::LibXML::SAX::Parser::
3 | 1 | 1 | 112µs | 91.8ms | _parse_systemid | XML::LibXML::SAX::Parser::
1 | 1 | 1 | 21µs | 28µs | BEGIN@12 | XML::LibXML::SAX::Parser::
1 | 1 | 1 | 12µs | 66µs | BEGIN@13 | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | CLONE_SKIP | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | __ANON__[:77] | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | __ANON__[:78] | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | __ANON__[:79] | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | __ANON__[:80] | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | __ANON__[:81] | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | __ANON__[:82] | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | _parse_bytestream | XML::LibXML::SAX::Parser::
0 | 0 | 0 | 0s | 0s | _parse_characterstream | XML::LibXML::SAX::Parser::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # $Id: Parser.pm 785 2009-07-16 14:17:46Z pajas $ | ||||
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 | |||||
10 | package XML::LibXML::SAX::Parser; | ||||
11 | |||||
12 | 3 | 37µs | 2 | 35µs | # spent 28µs (21+7) within XML::LibXML::SAX::Parser::BEGIN@12 which was called:
# once (21µs+7µs) by XML::SAX::ParserFactory::parser at line 12 # spent 28µs making 1 call to XML::LibXML::SAX::Parser::BEGIN@12
# spent 7µs making 1 call to strict::import |
13 | 3 | 40µs | 2 | 120µs | # spent 66µs (12+54) within XML::LibXML::SAX::Parser::BEGIN@13 which was called:
# once (12µs+54µs) by XML::SAX::ParserFactory::parser at line 13 # spent 66µs making 1 call to XML::LibXML::SAX::Parser::BEGIN@13
# spent 54µs making 1 call to vars::import |
14 | |||||
15 | 3 | 185µs | 2 | 29.3ms | # spent 29.0ms (11.9+17.1) within XML::LibXML::SAX::Parser::BEGIN@15 which was called:
# once (11.9ms+17.1ms) by XML::SAX::ParserFactory::parser at line 15 # spent 29.0ms making 1 call to XML::LibXML::SAX::Parser::BEGIN@15
# spent 335µs making 1 call to XML::LibXML::import |
16 | 3 | 225µs | 2 | 6.05ms | # spent 5.38ms (2.13+3.25) within XML::LibXML::SAX::Parser::BEGIN@16 which was called:
# once (2.13ms+3.25ms) by XML::SAX::ParserFactory::parser at line 16 # spent 5.38ms making 1 call to XML::LibXML::SAX::Parser::BEGIN@16
# spent 675µs making 1 call to Exporter::import |
17 | 3 | 267µs | 1 | 17.8ms | # spent 17.8ms (17.7+92µs) within XML::LibXML::SAX::Parser::BEGIN@17 which was called:
# once (17.7ms+92µs) by XML::SAX::ParserFactory::parser at line 17 # spent 17.8ms making 1 call to XML::LibXML::SAX::Parser::BEGIN@17 |
18 | 3 | 1.61ms | 1 | 785µs | # spent 785µs (754+30) within XML::LibXML::SAX::Parser::BEGIN@18 which was called:
# once (754µs+30µs) by XML::SAX::ParserFactory::parser at line 18 # spent 785µs making 1 call to XML::LibXML::SAX::Parser::BEGIN@18 |
19 | |||||
20 | 1 | 2µs | $VERSION = "1.70"; # VERSION TEMPLATE: DO NOT CHANGE | ||
21 | 1 | 16µs | @ISA = ('XML::SAX::Base'); | ||
22 | |||||
23 | sub CLONE_SKIP { | ||||
24 | return $XML::LibXML::__threads_shared ? 0 : 1; | ||||
25 | } | ||||
26 | |||||
27 | sub _parse_characterstream { | ||||
28 | my ($self, $fh, $options) = @_; | ||||
29 | die "parsing a characterstream is not supported at this time"; | ||||
30 | } | ||||
31 | |||||
32 | sub _parse_bytestream { | ||||
33 | my ($self, $fh, $options) = @_; | ||||
34 | my $parser = XML::LibXML->new(); | ||||
35 | my $doc = exists($options->{Source}{SystemId}) ? $parser->parse_fh($fh, $options->{Source}{SystemId}) : $parser->parse_fh($fh); | ||||
36 | $self->generate($doc); | ||||
37 | } | ||||
38 | |||||
39 | # spent 467ms (1.08+466) within XML::LibXML::SAX::Parser::_parse_string which was called 25 times, avg 18.7ms/call:
# 25 times (1.08ms+466ms) by XML::SAX::Base::parse at line 2602 of XML/SAX/Base.pm, avg 18.7ms/call | ||||
40 | 25 | 94µs | my ($self, $str, $options) = @_; | ||
41 | 25 | 159µs | 25 | 310µs | my $parser = XML::LibXML->new(); # spent 310µs making 25 calls to XML::LibXML::new, avg 12µs/call |
42 | 25 | 213µs | 25 | 10.9ms | my $doc = exists($options->{Source}{SystemId}) ? $parser->parse_string($str, $options->{Source}{SystemId}) : $parser->parse_string($str); # spent 10.9ms making 25 calls to XML::LibXML::parse_string, avg 436µs/call |
43 | 25 | 1.91ms | 50 | 453ms | $self->generate($doc); # spent 453ms making 25 calls to XML::LibXML::SAX::Parser::generate, avg 18.1ms/call
# spent 50µs making 25 calls to XML::LibXML::Node::DESTROY, avg 2µs/call |
44 | } | ||||
45 | |||||
46 | # spent 91.8ms (112µs+91.7) within XML::LibXML::SAX::Parser::_parse_systemid which was called 3 times, avg 30.6ms/call:
# 3 times (112µs+91.7ms) by XML::SAX::Base::parse at line 2602 of XML/SAX/Base.pm, avg 30.6ms/call | ||||
47 | 3 | 5µs | my ($self, $sysid, $options) = @_; | ||
48 | 3 | 20µs | 3 | 68µs | my $parser = XML::LibXML->new(); # spent 68µs making 3 calls to XML::LibXML::new, avg 23µs/call |
49 | 3 | 17µs | 3 | 2.13ms | my $doc = $parser->parse_file($sysid); # spent 2.13ms making 3 calls to XML::LibXML::parse_file, avg 711µs/call |
50 | 3 | 262µs | 6 | 89.3ms | $self->generate($doc); # spent 89.3ms making 3 calls to XML::LibXML::SAX::Parser::generate, avg 29.8ms/call
# spent 6µs making 3 calls to XML::LibXML::Node::DESTROY, avg 2µs/call |
51 | } | ||||
52 | |||||
53 | # spent 542ms (3.67+539) within XML::LibXML::SAX::Parser::generate which was called 28 times, avg 19.4ms/call:
# 25 times (3.21ms+450ms) by XML::LibXML::SAX::Parser::_parse_string at line 43, avg 18.1ms/call
# 3 times (460µs+88.8ms) by XML::LibXML::SAX::Parser::_parse_systemid at line 50, avg 29.8ms/call | ||||
54 | 28 | 24µs | my $self = shift; | ||
55 | 28 | 29µs | my ($node) = @_; | ||
56 | |||||
57 | 28 | 461µs | 28 | 246µs | my $doc = $node->ownerDocument(); # spent 246µs making 28 calls to XML::LibXML::Node::ownerDocument, avg 9µs/call |
58 | { | ||||
59 | # precompute some DocumentLocator values | ||||
60 | 56 | 582µs | my %locator = ( | ||
61 | PublicId => undef, | ||||
62 | SystemId => undef, | ||||
63 | Encoding => undef, | ||||
64 | XMLVersion => undef, | ||||
65 | ); | ||||
66 | 28 | 287µs | 28 | 86µs | my $dtd = defined $doc ? $doc->externalSubset() : undef; # spent 86µs making 28 calls to XML::LibXML::Document::externalSubset, avg 3µs/call |
67 | 28 | 14µs | if (defined $dtd) { | ||
68 | $locator{PublicId} = $dtd->publicId(); | ||||
69 | $locator{SystemId} = $dtd->systemId(); | ||||
70 | } | ||||
71 | 28 | 26µs | if (defined $doc) { | ||
72 | 28 | 216µs | 28 | 80µs | $locator{Encoding} = $doc->encoding(); # spent 80µs making 28 calls to XML::LibXML::Document::encoding, avg 3µs/call |
73 | 28 | 194µs | 28 | 70µs | $locator{XMLVersion} = $doc->version(); # spent 70µs making 28 calls to XML::LibXML::Document::version, avg 3µs/call |
74 | } | ||||
75 | $self->set_document_locator( | ||||
76 | XML::SAX::DocumentLocator->new( | ||||
77 | sub { $locator{PublicId} }, | ||||
78 | sub { $locator{SystemId} }, | ||||
79 | sub { defined($self->{current_node}) ? $self->{current_node}->line_number() : undef }, | ||||
80 | sub { 1 }, | ||||
81 | sub { $locator{Encoding} }, | ||||
82 | sub { $locator{XMLVersion} }, | ||||
83 | 28 | 897µs | 56 | 2.75ms | ), # spent 1.46ms making 28 calls to XML::SAX::Base::set_document_locator, avg 52µs/call
# spent 1.30ms making 28 calls to XML::SAX::DocumentLocator::new, avg 46µs/call |
84 | ); | ||||
85 | } | ||||
86 | |||||
87 | 28 | 712µs | 28 | 124µs | if ( $node->nodeType() == XML_DOCUMENT_NODE # spent 124µs making 28 calls to XML::LibXML::Node::nodeType, avg 4µs/call |
88 | || $node->nodeType == XML_HTML_DOCUMENT_NODE ) { | ||||
89 | 28 | 172µs | 28 | 1.36ms | $self->start_document({}); # spent 1.36ms making 28 calls to XML::SAX::Base::start_document, avg 48µs/call |
90 | 28 | 564µs | 84 | 1.37ms | $self->xml_decl({Version => $node->getVersion, Encoding => $node->getEncoding}); # spent 1.24ms making 28 calls to XML::SAX::Base::xml_decl, avg 44µs/call
# spent 86µs making 28 calls to XML::LibXML::Document::getVersion, avg 3µs/call
# spent 51µs making 28 calls to XML::LibXML::Document::getEncoding, avg 2µs/call |
91 | 28 | 285µs | 28 | 531ms | $self->process_node($node); # spent 531ms making 28 calls to XML::LibXML::SAX::Parser::process_node, avg 19.0ms/call |
92 | 28 | 200µs | 56 | 1.69ms | $self->end_document({}); # spent 1.64ms making 28 calls to XML::SAX::Base::end_document, avg 59µs/call
# spent 54µs making 28 calls to XML::LibXML::Node::DESTROY, avg 2µs/call |
93 | } | ||||
94 | } | ||||
95 | |||||
96 | # spent 531ms (62.0+469) within XML::LibXML::SAX::Parser::process_node which was called 4833 times, avg 110µs/call:
# 4777 times (60.8ms+-60.8ms) by XML::LibXML::SAX::Parser::process_element at line 244, avg 0s/call
# 28 times (849µs+530ms) by XML::LibXML::SAX::Parser::generate at line 91, avg 19.0ms/call
# 28 times (387µs+-387µs) by XML::LibXML::SAX::Parser::process_node at line 127, avg 0s/call | ||||
97 | 4833 | 3.62ms | my ($self, $node) = @_; | ||
98 | |||||
99 | 4833 | 6.26ms | local $self->{current_node} = $node; | ||
100 | |||||
101 | 4833 | 25.6ms | 4833 | 10.6ms | my $node_type = $node->nodeType(); # spent 10.6ms making 4833 calls to XML::LibXML::Node::nodeType, avg 2µs/call |
102 | 4833 | 45.3ms | 8044 | 589ms | if ($node_type == XML_COMMENT_NODE) { # spent 1.35s making 1619 calls to XML::LibXML::SAX::Parser::process_element, avg 832µs/call, recursion: max depth 7, sum of overlapping time 818ms
# spent 49.8ms making 3147 calls to XML::SAX::Base::characters, avg 16µs/call
# spent 8.75ms making 3147 calls to XML::LibXML::Node::nodeValue, avg 3µs/call
# spent 502µs making 28 calls to XML::LibXML::Node::childNodes, avg 18µs/call
# spent 493µs making 39 calls to XML::SAX::Base::comment, avg 13µs/call
# spent 206µs making 39 calls to XML::LibXML::Node::getData, avg 5µs/call
# spent 68µs making 25 calls to XML::LibXML::Namespace::DESTROY, avg 3µs/call |
103 | $self->comment( { Data => $node->getData } ); | ||||
104 | } | ||||
105 | elsif ($node_type == XML_TEXT_NODE | ||||
106 | || $node_type == XML_CDATA_SECTION_NODE) { | ||||
107 | # warn($node->getData . "\n"); | ||||
108 | $self->characters( { Data => $node->nodeValue } ); | ||||
109 | } | ||||
110 | elsif ($node_type == XML_ELEMENT_NODE) { | ||||
111 | # warn("<" . $node->getName . ">\n"); | ||||
112 | $self->process_element($node); | ||||
113 | # warn("</" . $node->getName . ">\n"); | ||||
114 | } | ||||
115 | elsif ($node_type == XML_ENTITY_REF_NODE) { | ||||
116 | foreach my $kid ($node->childNodes) { | ||||
117 | # warn("child of entity ref: " . $kid->getType() . " called: " . $kid->getName . "\n"); | ||||
118 | $self->process_node($kid); | ||||
119 | } | ||||
120 | } | ||||
121 | elsif ($node_type == XML_DOCUMENT_NODE | ||||
122 | || $node_type == XML_HTML_DOCUMENT_NODE | ||||
123 | || $node_type == XML_DOCUMENT_FRAG_NODE) { | ||||
124 | # some times it is just usefull to generate SAX events from | ||||
125 | # a document fragment (very good with filters). | ||||
126 | foreach my $kid ($node->childNodes) { | ||||
127 | 28 | 277µs | 53 | 34µs | $self->process_node($kid); # spent 34µs making 25 calls to XML::LibXML::Namespace::DESTROY, avg 1µs/call
# spent 529ms making 28 calls to XML::LibXML::SAX::Parser::process_node, avg 18.9ms/call, recursion: max depth 1, sum of overlapping time 529ms |
128 | } | ||||
129 | } | ||||
130 | elsif ($node_type == XML_PI_NODE) { | ||||
131 | $self->processing_instruction( { Target => $node->getName, Data => $node->getData } ); | ||||
132 | } | ||||
133 | elsif ($node_type == XML_COMMENT_NODE) { | ||||
134 | $self->comment( { Data => $node->getData } ); | ||||
135 | } | ||||
136 | elsif ( $node_type == XML_XINCLUDE_START | ||||
137 | || $node_type == XML_XINCLUDE_END ) { | ||||
138 | # ignore! | ||||
139 | # i may want to handle this one day, dunno yet | ||||
140 | } | ||||
141 | elsif ($node_type == XML_DTD_NODE ) { | ||||
142 | # ignore! | ||||
143 | # i will support DTDs, but had no time yet. | ||||
144 | } | ||||
145 | else { | ||||
146 | # warn("unsupported node type: $node_type"); | ||||
147 | } | ||||
148 | |||||
149 | } | ||||
150 | |||||
151 | # spent 529ms (189+340) within XML::LibXML::SAX::Parser::process_element which was called 1619 times, avg 327µs/call:
# 1619 times (189ms+340ms) by XML::LibXML::SAX::Parser::process_node at line 102, avg 327µs/call | ||||
152 | 1619 | 987µs | my ($self, $element) = @_; | ||
153 | |||||
154 | 1619 | 1.23ms | my $attribs = {}; | ||
155 | 1619 | 8.01ms | 1619 | 2.80ms | my @ns_maps = $element->getNamespaces; # spent 2.80ms making 1619 calls to XML::LibXML::Node::getNamespaces, avg 2µs/call |
156 | |||||
157 | 1619 | 2.02ms | foreach my $ns (@ns_maps) { | ||
158 | 53 | 1.16ms | 187 | 2.24ms | $self->start_prefix_mapping( # spent 1.99ms making 53 calls to XML::SAX::Base::start_prefix_mapping, avg 38µs/call
# spent 139µs making 53 calls to XML::LibXML::Namespace::href, avg 3µs/call
# spent 115µs making 81 calls to XML::LibXML::Namespace::localname, avg 1µs/call |
159 | { | ||||
160 | NamespaceURI => $ns->href, | ||||
161 | Prefix => ( defined $ns->localname ? $ns->localname : ''), | ||||
162 | } | ||||
163 | ); | ||||
164 | } | ||||
165 | |||||
166 | 1619 | 18.1ms | 1619 | 18.3ms | foreach my $attr ($element->attributes) { # spent 18.3ms making 1619 calls to XML::LibXML::Node::attributes, avg 11µs/call |
167 | 2634 | 655µs | my $key; | ||
168 | # warn("Attr: $attr -> ", $attr->getName, " = ", $attr->getData, "\n"); | ||||
169 | # this isa dump thing... | ||||
170 | 2634 | 17.9ms | 2634 | 6.71ms | if ($attr->isa('XML::LibXML::Namespace')) { # spent 6.71ms making 2634 calls to UNIVERSAL::isa, avg 3µs/call |
171 | # TODO This needs fixing modulo agreeing on what | ||||
172 | # is the right thing to do here. | ||||
173 | 53 | 205µs | 53 | 206µs | unless ( defined $attr->name ) { # spent 206µs making 53 calls to XML::LibXML::Namespace::name, avg 4µs/call |
174 | ## It's an atter like "xmlns='foo'" | ||||
175 | $attribs->{"{}xmlns"} = | ||||
176 | { | ||||
177 | Name => "xmlns", | ||||
178 | LocalName => "xmlns", | ||||
179 | Prefix => "", | ||||
180 | Value => $attr->href, | ||||
181 | NamespaceURI => "", | ||||
182 | }; | ||||
183 | } | ||||
184 | else { | ||||
185 | 53 | 49µs | my $prefix = "xmlns"; | ||
186 | 53 | 282µs | 53 | 84µs | my $localname = $attr->localname; # spent 84µs making 53 calls to XML::LibXML::Namespace::localname, avg 2µs/call |
187 | 53 | 89µs | my $key = "{http://www.w3.org/2000/xmlns/}"; | ||
188 | 53 | 26µs | my $name = "xmlns"; | ||
189 | |||||
190 | 53 | 37µs | if ( defined $localname ) { | ||
191 | 28 | 20µs | $key .= $localname; | ||
192 | 28 | 27µs | $name.= ":".$localname; | ||
193 | } | ||||
194 | |||||
195 | 53 | 603µs | 53 | 99µs | $attribs->{$key} = # spent 99µs making 53 calls to XML::LibXML::Namespace::href, avg 2µs/call |
196 | { | ||||
197 | Name => $name, | ||||
198 | Value => $attr->href, | ||||
199 | NamespaceURI => "http://www.w3.org/2000/xmlns/", | ||||
200 | Prefix => $prefix, | ||||
201 | LocalName => $localname, | ||||
202 | }; | ||||
203 | } | ||||
204 | } | ||||
205 | else { | ||||
206 | 2581 | 11.4ms | 2581 | 4.42ms | my $ns = $attr->namespaceURI; # spent 4.42ms making 2581 calls to XML::LibXML::Node::namespaceURI, avg 2µs/call |
207 | |||||
208 | 2581 | 1.49ms | $ns = '' unless defined $ns; | ||
209 | 2581 | 13.5ms | 2581 | 4.94ms | $key = "{$ns}".$attr->localname; # spent 4.94ms making 2581 calls to XML::LibXML::Node::localname, avg 2µs/call |
210 | ## Not sure why, but $attr->name is coming through stripped | ||||
211 | ## of its prefix, so we need to hand-assemble a real name. | ||||
212 | 2581 | 10.8ms | 2581 | 3.74ms | my $name = $attr->name; # spent 3.74ms making 2581 calls to XML::LibXML::Attr::name, avg 1µs/call |
213 | 2581 | 842µs | $name = "" unless defined $name; | ||
214 | |||||
215 | 2581 | 10.1ms | 2581 | 3.66ms | my $prefix = $attr->prefix; # spent 3.66ms making 2581 calls to XML::LibXML::Node::prefix, avg 1µs/call |
216 | 2581 | 1.17ms | $prefix = "" unless defined $prefix; | ||
217 | 2581 | 3.97ms | $name = "$prefix:$name" | ||
218 | if index( $name, ":" ) < 0 && length $prefix; | ||||
219 | |||||
220 | 2581 | 33.1ms | 5162 | 10.2ms | $attribs->{$key} = # spent 6.47ms making 2581 calls to XML::LibXML::Attr::value, avg 3µs/call
# spent 3.75ms making 2581 calls to XML::LibXML::Node::localname, avg 1µs/call |
221 | { | ||||
222 | Name => $name, | ||||
223 | Value => $attr->value, | ||||
224 | NamespaceURI => $ns, | ||||
225 | Prefix => $prefix, | ||||
226 | LocalName => $attr->localname, | ||||
227 | }; | ||||
228 | } | ||||
229 | # use Data::Dumper; | ||||
230 | # warn("Attr made: ", Dumper($attribs->{$key}), "\n"); | ||||
231 | } | ||||
232 | |||||
233 | 1619 | 30.3ms | 9110 | 15.5ms | my $node = { # spent 3.92ms making 1619 calls to XML::LibXML::Node::nodeName, avg 2µs/call
# spent 3.60ms making 2581 calls to XML::LibXML::Node::DESTROY, avg 1µs/call
# spent 3.06ms making 1619 calls to XML::LibXML::Node::namespaceURI, avg 2µs/call
# spent 2.40ms making 1619 calls to XML::LibXML::Node::localname, avg 1µs/call
# spent 2.18ms making 1619 calls to XML::LibXML::Node::prefix, avg 1µs/call
# spent 302µs making 53 calls to XML::LibXML::Namespace::DESTROY, avg 6µs/call |
234 | Name => $element->nodeName, | ||||
235 | Attributes => $attribs, | ||||
236 | NamespaceURI => $element->namespaceURI, | ||||
237 | Prefix => $element->prefix || "", | ||||
238 | LocalName => $element->localname, | ||||
239 | }; | ||||
240 | |||||
241 | 1619 | 4.25ms | 1619 | 35.0ms | $self->start_element($node); # spent 35.0ms making 1619 calls to XML::SAX::Base::start_element, avg 22µs/call |
242 | |||||
243 | 1619 | 26.0ms | 1619 | 22.9ms | foreach my $child ($element->childNodes) { # spent 22.9ms making 1619 calls to XML::LibXML::Node::childNodes, avg 14µs/call |
244 | 4777 | 18.5ms | 4780 | 7µs | $self->process_node($child); # spent 7µs making 3 calls to XML::LibXML::Namespace::DESTROY, avg 2µs/call
# spent 949ms making 4777 calls to XML::LibXML::SAX::Parser::process_node, avg 199µs/call, recursion: max depth 8, sum of overlapping time 949ms |
245 | } | ||||
246 | |||||
247 | 1619 | 7.82ms | 4777 | 6.28ms | my $end_node = { %$node }; # spent 6.28ms making 4777 calls to XML::LibXML::Node::DESTROY, avg 1µs/call |
248 | |||||
249 | 1619 | 1.47ms | delete $end_node->{Attributes}; | ||
250 | |||||
251 | 1619 | 3.99ms | 1619 | 68.8ms | $self->end_element($end_node); # spent 68.8ms making 1619 calls to XML::SAX::Base::end_element, avg 42µs/call |
252 | |||||
253 | 1619 | 12.7ms | foreach my $ns (@ns_maps) { | ||
254 | 53 | 1.25ms | 187 | 2.51ms | $self->end_prefix_mapping( # spent 2.24ms making 53 calls to XML::SAX::Base::end_prefix_mapping, avg 42µs/call
# spent 161µs making 53 calls to XML::LibXML::Namespace::href, avg 3µs/call
# spent 107µs making 81 calls to XML::LibXML::Namespace::localname, avg 1µs/call |
255 | { | ||||
256 | NamespaceURI => $ns->href, | ||||
257 | Prefix => ( defined $ns->localname ? $ns->localname : ''), | ||||
258 | } | ||||
259 | ); | ||||
260 | } | ||||
261 | } | ||||
262 | |||||
263 | 1 | 6µs | 1; | ||
264 | |||||
265 | __END__ |