← 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:28 2013

Filename/usr/lib64/perl5/vendor_perl/5.16.0/x86_64-linux/XML/LibXML/NodeList.pm
StatementsExecuted 17 statements in 4.48ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.47ms10.6msXML::LibXML::NodeList::::BEGIN@15XML::LibXML::NodeList::BEGIN@15
111113µs379µsXML::LibXML::NodeList::::BEGIN@23XML::LibXML::NodeList::BEGIN@23
11189µs193µsXML::LibXML::NodeList::::BEGIN@12XML::LibXML::NodeList::BEGIN@12
11158µs92µsXML::LibXML::NodeList::::BEGIN@13XML::LibXML::NodeList::BEGIN@13
11150µs190µsXML::LibXML::NodeList::::BEGIN@19XML::LibXML::NodeList::BEGIN@19
11137µs37µsXML::LibXML::NodeList::::BEGIN@16XML::LibXML::NodeList::BEGIN@16
11131µs31µsXML::LibXML::NodeList::::BEGIN@17XML::LibXML::NodeList::BEGIN@17
0000s0sXML::LibXML::NodeList::::__ANON__[:28]XML::LibXML::NodeList::__ANON__[:28]
0000s0sXML::LibXML::NodeList::::appendXML::LibXML::NodeList::append
0000s0sXML::LibXML::NodeList::::get_nodeXML::LibXML::NodeList::get_node
0000s0sXML::LibXML::NodeList::::get_nodelistXML::LibXML::NodeList::get_nodelist
0000s0sXML::LibXML::NodeList::::iteratorXML::LibXML::NodeList::iterator
0000s0sXML::LibXML::NodeList::::newXML::LibXML::NodeList::new
0000s0sXML::LibXML::NodeList::::new_from_refXML::LibXML::NodeList::new_from_ref
0000s0sXML::LibXML::NodeList::::popXML::LibXML::NodeList::pop
0000s0sXML::LibXML::NodeList::::prependXML::LibXML::NodeList::prepend
0000s0sXML::LibXML::NodeList::::pushXML::LibXML::NodeList::push
0000s0sXML::LibXML::NodeList::::shiftXML::LibXML::NodeList::shift
0000s0sXML::LibXML::NodeList::::sizeXML::LibXML::NodeList::size
0000s0sXML::LibXML::NodeList::::string_valueXML::LibXML::NodeList::string_value
0000s0sXML::LibXML::NodeList::::to_booleanXML::LibXML::NodeList::to_boolean
0000s0sXML::LibXML::NodeList::::to_literalXML::LibXML::NodeList::to_literal
0000s0sXML::LibXML::NodeList::::to_numberXML::LibXML::NodeList::to_number
0000s0sXML::LibXML::NodeList::::unshiftXML::LibXML::NodeList::unshift
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::NodeList;
11
122162µs2297µs
# spent 193µs (89+104) within XML::LibXML::NodeList::BEGIN@12 which was called: # once (89µs+104µs) by XML::LibXML::BEGIN@25 at line 12
use strict;
# spent 193µs making 1 call to XML::LibXML::NodeList::BEGIN@12 # spent 104µs making 1 call to strict::import
132155µs2126µs
# spent 92µs (58+34) within XML::LibXML::NodeList::BEGIN@13 which was called: # once (58µs+34µs) by XML::LibXML::BEGIN@25 at line 13
use warnings;
# spent 92µs making 1 call to XML::LibXML::NodeList::BEGIN@13 # spent 34µs making 1 call to warnings::import
14
152575µs110.6ms
# spent 10.6ms (2.47+8.13) within XML::LibXML::NodeList::BEGIN@15 which was called: # once (2.47ms+8.13ms) by XML::LibXML::BEGIN@25 at line 15
use XML::LibXML::Boolean;
# spent 10.6ms making 1 call to XML::LibXML::NodeList::BEGIN@15
162136µs137µs
# spent 37µs within XML::LibXML::NodeList::BEGIN@16 which was called: # once (37µs+0s) by XML::LibXML::BEGIN@25 at line 16
use XML::LibXML::Literal;
# spent 37µs making 1 call to XML::LibXML::NodeList::BEGIN@16
172147µs131µs
# spent 31µs within XML::LibXML::NodeList::BEGIN@17 which was called: # once (31µs+0s) by XML::LibXML::BEGIN@25 at line 17
use XML::LibXML::Number;
# spent 31µs making 1 call to XML::LibXML::NodeList::BEGIN@17
18
192521µs2329µs
# spent 190µs (50+139) within XML::LibXML::NodeList::BEGIN@19 which was called: # once (50µs+139µs) by XML::LibXML::BEGIN@25 at line 19
use vars qw($VERSION);
# spent 190µs making 1 call to XML::LibXML::NodeList::BEGIN@19 # spent 139µs making 1 call to vars::import
2014µs$VERSION = "1.90"; # VERSION TEMPLATE: DO NOT CHANGE
21
22use overload
23
# spent 379µs (113+266) within XML::LibXML::NodeList::BEGIN@23 which was called: # once (113µs+266µs) by XML::LibXML::BEGIN@25 at line 29
'""' => \&to_literal,
24 'bool' => \&to_boolean,
25 'cmp' => sub {
26 my($aa, $bb, $order) = @_;
27 return ($order ? ("$bb" cmp "$aa") : ("$aa" cmp "$bb"));
28 },
2922.76ms2645µs ;
# spent 379µs making 1 call to XML::LibXML::NodeList::BEGIN@23 # spent 266µs making 1 call to overload::import
30
31sub new {
32 my $class = shift;
33 bless [@_], $class;
34}
35
36sub new_from_ref {
37 my ($class,$array_ref,$reuse) = @_;
38 return bless $reuse ? $array_ref : [@$array_ref], $class;
39}
40
41sub pop {
42 my $self = CORE::shift;
43 CORE::pop @$self;
44}
45
46sub push {
47 my $self = CORE::shift;
48 CORE::push @$self, @_;
49}
50
51sub append {
52 my $self = CORE::shift;
53 my ($nodelist) = @_;
54 CORE::push @$self, $nodelist->get_nodelist;
55}
56
57sub shift {
58 my $self = CORE::shift;
59 CORE::shift @$self;
60}
61
62sub unshift {
63 my $self = CORE::shift;
64 CORE::unshift @$self, @_;
65}
66
67sub prepend {
68 my $self = CORE::shift;
69 my ($nodelist) = @_;
70 CORE::unshift @$self, $nodelist->get_nodelist;
71}
72
73sub size {
74 my $self = CORE::shift;
75 scalar @$self;
76}
77
78sub get_node {
79 # uses array index starting at 1, not 0
80 # this is mainly because of XPath.
81 my $self = CORE::shift;
82 my ($pos) = @_;
83 $self->[$pos - 1];
84}
85
8618µs*item = \&get_node;
87
88sub get_nodelist {
89 my $self = CORE::shift;
90 @$self;
91}
92
93sub to_boolean {
94 my $self = CORE::shift;
95 return (@$self > 0) ? XML::LibXML::Boolean->True : XML::LibXML::Boolean->False;
96}
97
98# string-value of a nodelist is the string-value of the first node
99sub string_value {
100 my $self = CORE::shift;
101 return '' unless @$self;
102 return $self->[0]->string_value;
103}
104
105sub to_literal {
106 my $self = CORE::shift;
107 return XML::LibXML::Literal->new(
108 join('', grep {defined $_} map { $_->string_value } @$self)
109 );
110}
111
112sub to_number {
113 my $self = CORE::shift;
114 return XML::LibXML::Number->new(
115 $self->to_literal
116 );
117}
118
119sub iterator {
120 warn "this function is obsolete!\nIt was disabled in version 1.54\n";
121 return undef;
122}
123
124117µs1;
125__END__