← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:01:54 2013

Filename/usr/lib/perl5/XML/LibXML/NodeList.pm
StatementsExecuted 21 statements in 853µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111570µs2.79msXML::LibXML::NodeList::::BEGIN@12XML::LibXML::NodeList::BEGIN@12
11129µs38µsXML::LibXML::NodeList::::BEGIN@11XML::LibXML::NodeList::BEGIN@11
11117µs54µsXML::LibXML::NodeList::::BEGIN@20XML::LibXML::NodeList::BEGIN@20
1118µs36µsXML::LibXML::NodeList::::BEGIN@16XML::LibXML::NodeList::BEGIN@16
1117µs7µsXML::LibXML::NodeList::::BEGIN@13XML::LibXML::NodeList::BEGIN@13
1115µs5µsXML::LibXML::NodeList::::BEGIN@14XML::LibXML::NodeList::BEGIN@14
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: NodeList.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
10package XML::LibXML::NodeList;
11348µs247µs
# spent 38µs (29+9) within XML::LibXML::NodeList::BEGIN@11 which was called: # once (29µs+9µs) by XML::LibXML::BEGIN@24 at line 11
use strict;
# spent 38µs making 1 call to XML::LibXML::NodeList::BEGIN@11 # spent 9µs making 1 call to strict::import
123163µs12.79ms
# spent 2.79ms (570µs+2.22) within XML::LibXML::NodeList::BEGIN@12 which was called: # once (570µs+2.22ms) by XML::LibXML::BEGIN@24 at line 12
use XML::LibXML::Boolean;
# spent 2.79ms making 1 call to XML::LibXML::NodeList::BEGIN@12
13325µs17µs
# spent 7µs within XML::LibXML::NodeList::BEGIN@13 which was called: # once (7µs+0s) by XML::LibXML::BEGIN@24 at line 13
use XML::LibXML::Literal;
# spent 7µs making 1 call to XML::LibXML::NodeList::BEGIN@13
14327µs15µs
# spent 5µs within XML::LibXML::NodeList::BEGIN@14 which was called: # once (5µs+0s) by XML::LibXML::BEGIN@24 at line 14
use XML::LibXML::Number;
# spent 5µs making 1 call to XML::LibXML::NodeList::BEGIN@14
15
16352µs264µs
# spent 36µs (8+28) within XML::LibXML::NodeList::BEGIN@16 which was called: # once (8µs+28µs) by XML::LibXML::BEGIN@24 at line 16
use vars qw ($VERSION);
# spent 36µs making 1 call to XML::LibXML::NodeList::BEGIN@16 # spent 28µs making 1 call to vars::import
171800ns$VERSION = "1.70"; # VERSION TEMPLATE: DO NOT CHANGE
18
19use overload
20113µs137µs
# spent 54µs (17+37) within XML::LibXML::NodeList::BEGIN@20 which was called: # once (17µs+37µs) by XML::LibXML::BEGIN@24 at line 22
'""' => \&to_literal,
# spent 37µs making 1 call to overload::import
21 'bool' => \&to_boolean,
222519µs154µs ;
# spent 54µs making 1 call to XML::LibXML::NodeList::BEGIN@20
23
24sub new {
25 my $class = shift;
26 bless [@_], $class;
27}
28
29sub new_from_ref {
30 my ($class,$array_ref,$reuse) = @_;
31 return bless $reuse ? $array_ref : [@$array_ref], $class;
32}
33
34sub pop {
35 my $self = CORE::shift;
36 CORE::pop @$self;
37}
38
39sub push {
40 my $self = CORE::shift;
41 CORE::push @$self, @_;
42}
43
44sub append {
45 my $self = CORE::shift;
46 my ($nodelist) = @_;
47 CORE::push @$self, $nodelist->get_nodelist;
48}
49
50sub shift {
51 my $self = CORE::shift;
52 CORE::shift @$self;
53}
54
55sub unshift {
56 my $self = CORE::shift;
57 CORE::unshift @$self, @_;
58}
59
60sub prepend {
61 my $self = CORE::shift;
62 my ($nodelist) = @_;
63 CORE::unshift @$self, $nodelist->get_nodelist;
64}
65
66sub size {
67 my $self = CORE::shift;
68 scalar @$self;
69}
70
71sub get_node {
72 # uses array index starting at 1, not 0
73 # this is mainly because of XPath.
74 my $self = CORE::shift;
75 my ($pos) = @_;
76 $self->[$pos - 1];
77}
78
7912µs*item = \&get_node;
80
81sub get_nodelist {
82 my $self = CORE::shift;
83 @$self;
84}
85
86sub to_boolean {
87 my $self = CORE::shift;
88 return (@$self > 0) ? XML::LibXML::Boolean->True : XML::LibXML::Boolean->False;
89}
90
91# string-value of a nodelist is the string-value of the first node
92sub string_value {
93 my $self = CORE::shift;
94 return '' unless @$self;
95 return $self->[0]->string_value;
96}
97
98sub to_literal {
99 my $self = CORE::shift;
100 return XML::LibXML::Literal->new(
101 join('', grep {defined $_} map { $_->string_value } @$self)
102 );
103}
104
105sub to_number {
106 my $self = CORE::shift;
107 return XML::LibXML::Number->new(
108 $self->to_literal
109 );
110}
111
112sub iterator {
113 warn "this function is obsolete!\nIt was disabled in version 1.54\n";
114 return undef;
115}
116
11714µs1;
118__END__