← 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/Number.pm
StatementsExecuted 17 statements in 790µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111875µs1.17msXML::LibXML::Number::::BEGIN@12XML::LibXML::Number::BEGIN@12
11141µs41µsXML::LibXML::Number::::BEGIN@11XML::LibXML::Number::BEGIN@11
11126µs89µsXML::LibXML::Number::::BEGIN@19XML::LibXML::Number::BEGIN@19
11125µs34µsXML::LibXML::Number::::BEGIN@13XML::LibXML::Number::BEGIN@13
11116µs62µsXML::LibXML::Number::::BEGIN@15XML::LibXML::Number::BEGIN@15
0000s0sXML::LibXML::Number::::as_stringXML::LibXML::Number::as_string
0000s0sXML::LibXML::Number::::as_xmlXML::LibXML::Number::as_xml
0000s0sXML::LibXML::Number::::cmpXML::LibXML::Number::cmp
0000s0sXML::LibXML::Number::::evaluateXML::LibXML::Number::evaluate
0000s0sXML::LibXML::Number::::newXML::LibXML::Number::new
0000s0sXML::LibXML::Number::::string_valueXML::LibXML::Number::string_value
0000s0sXML::LibXML::Number::::to_booleanXML::LibXML::Number::to_boolean
0000s0sXML::LibXML::Number::::to_literalXML::LibXML::Number::to_literal
0000s0sXML::LibXML::Number::::to_numberXML::LibXML::Number::to_number
0000s0sXML::LibXML::Number::::valueXML::LibXML::Number::value
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# $Id: Number.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::Number;
11358µs141µs
# spent 41µs within XML::LibXML::Number::BEGIN@11 which was called: # once (41µs+0s) by XML::LibXML::Boolean::BEGIN@12 at line 11
use XML::LibXML::Boolean;
# spent 41µs making 1 call to XML::LibXML::Number::BEGIN@11
123186µs11.17ms
# spent 1.17ms (875µs+295µs) within XML::LibXML::Number::BEGIN@12 which was called: # once (875µs+295µs) by XML::LibXML::Boolean::BEGIN@12 at line 12
use XML::LibXML::Literal;
# spent 1.17ms making 1 call to XML::LibXML::Number::BEGIN@12
13353µs243µs
# spent 34µs (25+9) within XML::LibXML::Number::BEGIN@13 which was called: # once (25µs+9µs) by XML::LibXML::Boolean::BEGIN@12 at line 13
use strict;
# spent 34µs making 1 call to XML::LibXML::Number::BEGIN@13 # spent 9µs making 1 call to strict::import
14
15387µs2108µs
# spent 62µs (16+46) within XML::LibXML::Number::BEGIN@15 which was called: # once (16µs+46µs) by XML::LibXML::Boolean::BEGIN@12 at line 15
use vars qw ($VERSION);
# spent 62µs making 1 call to XML::LibXML::Number::BEGIN@15 # spent 46µs making 1 call to vars::import
161900ns$VERSION = "1.70"; # VERSION TEMPLATE: DO NOT CHANGE
17
18use overload
19119µs163µs
# spent 89µs (26+63) within XML::LibXML::Number::BEGIN@19 which was called: # once (26µs+63µs) by XML::LibXML::Boolean::BEGIN@12 at line 21
'""' => \&value,
# spent 63µs making 1 call to overload::import
20 '0+' => \&value,
212382µs189µs '<=>' => \&cmp;
# spent 89µs making 1 call to XML::LibXML::Number::BEGIN@19
22
23sub new {
24 my $class = shift;
25 my $number = shift;
26 if ($number !~ /^\s*(-\s*)?(\d+(\.\d*)?|\.\d+)\s*$/) {
27 $number = undef;
28 }
29 else {
30 $number =~ s/\s+//g;
31 }
32 bless \$number, $class;
33}
34
35sub as_string {
36 my $self = shift;
37 defined $$self ? $$self : 'NaN';
38}
39
40sub as_xml {
41 my $self = shift;
42 return "<Number>" . (defined($$self) ? $$self : 'NaN') . "</Number>\n";
43}
44
45sub value {
46 my $self = shift;
47 $$self;
48}
49
50sub cmp {
51 my $self = shift;
52 my ($other, $swap) = @_;
53 if ($swap) {
54 return $other <=> $$self;
55 }
56 return $$self <=> $other;
57}
58
59sub evaluate {
60 my $self = shift;
61 $self;
62}
63
64sub to_boolean {
65 my $self = shift;
66 return $$self ? XML::LibXML::Boolean->True : XML::LibXML::Boolean->False;
67}
68
69sub to_literal { XML::LibXML::Literal->new($_[0]->as_string); }
70sub to_number { $_[0]; }
71
72sub string_value { return $_[0]->value }
73
7413µs1;
75__END__