| Filename | /usr/share/perl5/XML/SAX/DocumentLocator.pm |
| Statements | Executed 200 statements in 1.94ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 28 | 1 | 1 | 668µs | 1.30ms | XML::SAX::DocumentLocator::new |
| 28 | 1 | 1 | 630µs | 630µs | XML::SAX::DocumentLocator::TIEHASH |
| 1 | 1 | 1 | 22µs | 30µs | XML::SAX::DocumentLocator::BEGIN@4 |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::CLEAR |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::DELETE |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::EXISTS |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::FETCH |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::FIRSTKEY |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::NEXTKEY |
| 0 | 0 | 0 | 0s | 0s | XML::SAX::DocumentLocator::STORE |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # $Id: DocumentLocator.pm,v 1.3 2005-10-14 20:31:20 matt Exp $ | ||||
| 2 | |||||
| 3 | package XML::SAX::DocumentLocator; | ||||
| 4 | 3 | 615µs | 2 | 39µs | # spent 30µs (22+8) within XML::SAX::DocumentLocator::BEGIN@4 which was called:
# once (22µs+8µs) by XML::LibXML::SAX::Parser::BEGIN@18 at line 4 # spent 30µs making 1 call to XML::SAX::DocumentLocator::BEGIN@4
# spent 8µs making 1 call to strict::import |
| 5 | |||||
| 6 | # spent 1.30ms (668µs+629µs) within XML::SAX::DocumentLocator::new which was called 28 times, avg 46µs/call:
# 28 times (668µs+629µs) by XML::LibXML::SAX::Parser::generate at line 83 of XML/LibXML/SAX/Parser.pm, avg 46µs/call | ||||
| 7 | 28 | 60µs | my $class = shift; | ||
| 8 | 28 | 18µs | my %object; | ||
| 9 | 28 | 344µs | 28 | 630µs | tie %object, $class, @_; # spent 630µs making 28 calls to XML::SAX::DocumentLocator::TIEHASH, avg 22µs/call |
| 10 | |||||
| 11 | 28 | 218µs | return bless \%object, $class; | ||
| 12 | } | ||||
| 13 | |||||
| 14 | # spent 630µs within XML::SAX::DocumentLocator::TIEHASH which was called 28 times, avg 22µs/call:
# 28 times (630µs+0s) by XML::SAX::DocumentLocator::new at line 9, avg 22µs/call | ||||
| 15 | 28 | 49µs | my $class = shift; | ||
| 16 | 28 | 98µs | my ($pubmeth, $sysmeth, $linemeth, $colmeth, $encmeth, $xmlvmeth) = @_; | ||
| 17 | 28 | 529µs | return bless { | ||
| 18 | pubmeth => $pubmeth, | ||||
| 19 | sysmeth => $sysmeth, | ||||
| 20 | linemeth => $linemeth, | ||||
| 21 | colmeth => $colmeth, | ||||
| 22 | encmeth => $encmeth, | ||||
| 23 | xmlvmeth => $xmlvmeth, | ||||
| 24 | }, $class; | ||||
| 25 | } | ||||
| 26 | |||||
| 27 | sub FETCH { | ||||
| 28 | my ($self, $key) = @_; | ||||
| 29 | my $method; | ||||
| 30 | if ($key eq 'PublicId') { | ||||
| 31 | $method = $self->{pubmeth}; | ||||
| 32 | } | ||||
| 33 | elsif ($key eq 'SystemId') { | ||||
| 34 | $method = $self->{sysmeth}; | ||||
| 35 | } | ||||
| 36 | elsif ($key eq 'LineNumber') { | ||||
| 37 | $method = $self->{linemeth}; | ||||
| 38 | } | ||||
| 39 | elsif ($key eq 'ColumnNumber') { | ||||
| 40 | $method = $self->{colmeth}; | ||||
| 41 | } | ||||
| 42 | elsif ($key eq 'Encoding') { | ||||
| 43 | $method = $self->{encmeth}; | ||||
| 44 | } | ||||
| 45 | elsif ($key eq 'XMLVersion') { | ||||
| 46 | $method = $self->{xmlvmeth}; | ||||
| 47 | } | ||||
| 48 | if ($method) { | ||||
| 49 | my $value = $method->($key); | ||||
| 50 | return $value; | ||||
| 51 | } | ||||
| 52 | return undef; | ||||
| 53 | } | ||||
| 54 | |||||
| 55 | sub EXISTS { | ||||
| 56 | my ($self, $key) = @_; | ||||
| 57 | if ($key =~ /^(PublicId|SystemId|LineNumber|ColumnNumber|Encoding|XMLVersion)$/) { | ||||
| 58 | return 1; | ||||
| 59 | } | ||||
| 60 | return 0; | ||||
| 61 | } | ||||
| 62 | |||||
| 63 | sub STORE { | ||||
| 64 | my ($self, $key, $value) = @_; | ||||
| 65 | } | ||||
| 66 | |||||
| 67 | sub DELETE { | ||||
| 68 | my ($self, $key) = @_; | ||||
| 69 | } | ||||
| 70 | |||||
| 71 | sub CLEAR { | ||||
| 72 | my ($self) = @_; | ||||
| 73 | } | ||||
| 74 | |||||
| 75 | sub FIRSTKEY { | ||||
| 76 | my ($self) = @_; | ||||
| 77 | # assignment resets. | ||||
| 78 | $self->{keys} = { | ||||
| 79 | PublicId => 1, | ||||
| 80 | SystemId => 1, | ||||
| 81 | LineNumber => 1, | ||||
| 82 | ColumnNumber => 1, | ||||
| 83 | Encoding => 1, | ||||
| 84 | XMLVersion => 1, | ||||
| 85 | }; | ||||
| 86 | return each %{$self->{keys}}; | ||||
| 87 | } | ||||
| 88 | |||||
| 89 | sub NEXTKEY { | ||||
| 90 | my ($self, $lastkey) = @_; | ||||
| 91 | return each %{$self->{keys}}; | ||||
| 92 | } | ||||
| 93 | |||||
| 94 | 1 | 4µs | 1; | ||
| 95 | __END__ |