← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:49 2015

Filename/usr/lib/x86_64-linux-gnu/perl5/5.20/XML/LibXML/Literal.pm
StatementsExecuted 14 statements in 856µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs36µsXML::LibXML::Literal::::BEGIN@22XML::LibXML::Literal::BEGIN@22
1119µs9µsXML::LibXML::Literal::::BEGIN@12XML::LibXML::Literal::BEGIN@12
1116µs16µsXML::LibXML::Literal::::BEGIN@15XML::LibXML::Literal::BEGIN@15
1116µs6µsXML::LibXML::Literal::::BEGIN@13XML::LibXML::Literal::BEGIN@13
1116µs10µsXML::LibXML::Literal::::BEGIN@16XML::LibXML::Literal::BEGIN@16
1116µs23µsXML::LibXML::Literal::::BEGIN@18XML::LibXML::Literal::BEGIN@18
0000s0sXML::LibXML::Literal::::as_stringXML::LibXML::Literal::as_string
0000s0sXML::LibXML::Literal::::as_xmlXML::LibXML::Literal::as_xml
0000s0sXML::LibXML::Literal::::cmpXML::LibXML::Literal::cmp
0000s0sXML::LibXML::Literal::::evaluateXML::LibXML::Literal::evaluate
0000s0sXML::LibXML::Literal::::newXML::LibXML::Literal::new
0000s0sXML::LibXML::Literal::::string_valueXML::LibXML::Literal::string_value
0000s0sXML::LibXML::Literal::::to_booleanXML::LibXML::Literal::to_boolean
0000s0sXML::LibXML::Literal::::to_literalXML::LibXML::Literal::to_literal
0000s0sXML::LibXML::Literal::::to_numberXML::LibXML::Literal::to_number
0000s0sXML::LibXML::Literal::::valueXML::LibXML::Literal::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$
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::Literal;
11
12223µs19µs
# spent 9µs within XML::LibXML::Literal::BEGIN@12 which was called: # once (9µs+0s) by XML::LibXML::Number::BEGIN@12 at line 12
use XML::LibXML::Boolean;
# spent 9µs making 1 call to XML::LibXML::Literal::BEGIN@12
13222µs16µs
# spent 6µs within XML::LibXML::Literal::BEGIN@13 which was called: # once (6µs+0s) by XML::LibXML::Number::BEGIN@12 at line 13
use XML::LibXML::Number;
# spent 6µs making 1 call to XML::LibXML::Literal::BEGIN@13
14
15220µs226µs
# spent 16µs (6+10) within XML::LibXML::Literal::BEGIN@15 which was called: # once (6µs+10µs) by XML::LibXML::Number::BEGIN@12 at line 15
use strict;
# spent 16µs making 1 call to XML::LibXML::Literal::BEGIN@15 # spent 10µs making 1 call to strict::import
16222µs214µs
# spent 10µs (6+4) within XML::LibXML::Literal::BEGIN@16 which was called: # once (6µs+4µs) by XML::LibXML::Number::BEGIN@12 at line 16
use warnings;
# spent 10µs making 1 call to XML::LibXML::Literal::BEGIN@16 # spent 4µs making 1 call to warnings::import
17
18245µs240µs
# spent 23µs (6+17) within XML::LibXML::Literal::BEGIN@18 which was called: # once (6µs+17µs) by XML::LibXML::Number::BEGIN@12 at line 18
use vars qw ($VERSION);
# spent 23µs making 1 call to XML::LibXML::Literal::BEGIN@18 # spent 17µs making 1 call to vars::import
191300ns$VERSION = "2.0116"; # VERSION TEMPLATE: DO NOT CHANGE
20
21use overload
2216µs126µs
# spent 36µs (9+26) within XML::LibXML::Literal::BEGIN@22 which was called: # once (9µs+26µs) by XML::LibXML::Number::BEGIN@12 at line 23
'""' => \&value,
# spent 26µs making 1 call to overload::import
231715µs136µs 'cmp' => \&cmp;
# spent 36µs making 1 call to XML::LibXML::Literal::BEGIN@22
24
25sub new {
26 my $class = shift;
27 my ($string) = @_;
28
29# $string =~ s/"/"/g;
30# $string =~ s/'/'/g;
31
32 bless \$string, $class;
33}
34
35sub as_string {
36 my $self = shift;
37 my $string = $$self;
38 $string =~ s/'/'/g;
39 return "'$string'";
40}
41
42sub as_xml {
43 my $self = shift;
44 my $string = $$self;
45 return "<Literal>$string</Literal>\n";
46}
47
48sub value {
49 my $self = shift;
50 $$self;
51}
52
53sub cmp {
54 my $self = shift;
55 my ($cmp, $swap) = @_;
56 if ($swap) {
57 return $cmp cmp $$self;
58 }
59 return $$self cmp $cmp;
60}
61
62sub evaluate {
63 my $self = shift;
64 $self;
65}
66
67sub to_boolean {
68 my $self = shift;
69 return (length($$self) > 0) ? XML::LibXML::Boolean->True : XML::LibXML::Boolean->False;
70}
71
72sub to_number { return XML::LibXML::Number->new($_[0]->value); }
73sub to_literal { return $_[0]; }
74
75sub string_value { return $_[0]->value; }
76
7712µs1;
78__END__