← 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/Boolean.pm
StatementsExecuted 14 statements in 951µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111000µs2.69msXML::LibXML::Boolean::::BEGIN@12XML::LibXML::Boolean::BEGIN@12
1117µs23µsXML::LibXML::Boolean::::BEGIN@22XML::LibXML::Boolean::BEGIN@22
1116µs10µsXML::LibXML::Boolean::::BEGIN@15XML::LibXML::Boolean::BEGIN@15
1116µs21µsXML::LibXML::Boolean::::BEGIN@17XML::LibXML::Boolean::BEGIN@17
1115µs15µsXML::LibXML::Boolean::::BEGIN@14XML::LibXML::Boolean::BEGIN@14
1114µs4µsXML::LibXML::Boolean::::BEGIN@13XML::LibXML::Boolean::BEGIN@13
0000s0sXML::LibXML::Boolean::::FalseXML::LibXML::Boolean::False
0000s0sXML::LibXML::Boolean::::TrueXML::LibXML::Boolean::True
0000s0sXML::LibXML::Boolean::::cmpXML::LibXML::Boolean::cmp
0000s0sXML::LibXML::Boolean::::newXML::LibXML::Boolean::new
0000s0sXML::LibXML::Boolean::::string_valueXML::LibXML::Boolean::string_value
0000s0sXML::LibXML::Boolean::::to_booleanXML::LibXML::Boolean::to_boolean
0000s0sXML::LibXML::Boolean::::to_literalXML::LibXML::Boolean::to_literal
0000s0sXML::LibXML::Boolean::::to_numberXML::LibXML::Boolean::to_number
0000s0sXML::LibXML::Boolean::::valueXML::LibXML::Boolean::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#
4# This is free software, you may use it and distribute it under the same terms as
5# Perl itself.
6#
7# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
8#
9#
10
11package XML::LibXML::Boolean;
122645µs12.69ms
# spent 2.69ms (1000µs+1.69) within XML::LibXML::Boolean::BEGIN@12 which was called: # once (1000µs+1.69ms) by XML::LibXML::NodeList::BEGIN@15 at line 12
use XML::LibXML::Number;
# spent 2.69ms making 1 call to XML::LibXML::Boolean::BEGIN@12
13218µs14µs
# spent 4µs within XML::LibXML::Boolean::BEGIN@13 which was called: # once (4µs+0s) by XML::LibXML::NodeList::BEGIN@15 at line 13
use XML::LibXML::Literal;
# spent 4µs making 1 call to XML::LibXML::Boolean::BEGIN@13
14218µs224µs
# spent 15µs (5+10) within XML::LibXML::Boolean::BEGIN@14 which was called: # once (5µs+10µs) by XML::LibXML::NodeList::BEGIN@15 at line 14
use strict;
# spent 15µs making 1 call to XML::LibXML::Boolean::BEGIN@14 # spent 10µs making 1 call to strict::import
15220µs213µs
# spent 10µs (6+3) within XML::LibXML::Boolean::BEGIN@15 which was called: # once (6µs+3µs) by XML::LibXML::NodeList::BEGIN@15 at line 15
use warnings;
# spent 10µs making 1 call to XML::LibXML::Boolean::BEGIN@15 # spent 3µs making 1 call to warnings::import
16
17237µs237µs
# spent 21µs (6+15) within XML::LibXML::Boolean::BEGIN@17 which was called: # once (6µs+15µs) by XML::LibXML::NodeList::BEGIN@15 at line 17
use vars qw ($VERSION);
# spent 21µs making 1 call to XML::LibXML::Boolean::BEGIN@17 # spent 15µs making 1 call to vars::import
18
191400ns$VERSION = "2.0116"; # VERSION TEMPLATE: DO NOT CHANGE
20
21use overload
2215µs116µs
# spent 23µs (7+16) within XML::LibXML::Boolean::BEGIN@22 which was called: # once (7µs+16µs) by XML::LibXML::NodeList::BEGIN@15 at line 23
'""' => \&value,
# spent 16µs making 1 call to overload::import
231206µs123µs '<=>' => \&cmp;
# spent 23µs making 1 call to XML::LibXML::Boolean::BEGIN@22
24
25sub new {
26 my $class = shift;
27 my ($param) = @_;
28 my $val = $param ? 1 : 0;
29 bless \$val, $class;
30}
31
32sub True {
33 my $class = shift;
34 my $val = 1;
35 bless \$val, $class;
36}
37
38sub False {
39 my $class = shift;
40 my $val = 0;
41 bless \$val, $class;
42}
43
44sub value {
45 my $self = shift;
46 $$self;
47}
48
49sub cmp {
50 my $self = shift;
51 my ($other, $swap) = @_;
52 if ($swap) {
53 return $other <=> $$self;
54 }
55 return $$self <=> $other;
56}
57
58sub to_number { XML::LibXML::Number->new($_[0]->value); }
59sub to_boolean { $_[0]; }
60sub to_literal { XML::LibXML::Literal->new($_[0]->value ? "true" : "false"); }
61
62sub string_value { return $_[0]->to_literal->value; }
63
6412µs1;
65__END__