| Filename | /usr/share/perl5/URI/Split.pm |
| Statements | Executed 150 statements in 4.46ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 137 | 1 | 1 | 2.13ms | 2.13ms | URI::Split::CORE:match (opcode) |
| 137 | 1 | 1 | 1.34ms | 3.47ms | URI::Split::uri_split |
| 1 | 1 | 1 | 34µs | 43µs | URI::Split::BEGIN@3 |
| 1 | 1 | 1 | 18µs | 98µs | URI::Split::BEGIN@5 |
| 1 | 1 | 1 | 9µs | 9µs | URI::Split::BEGIN@10 |
| 0 | 0 | 0 | 0s | 0s | URI::Split::uri_join |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package URI::Split; | ||||
| 2 | |||||
| 3 | 3 | 62µs | 2 | 52µs | # spent 43µs (34+9) within URI::Split::BEGIN@3 which was called:
# once (34µs+9µs) by C4::Koha::getitemtypeimagelocation at line 3 # spent 43µs making 1 call to URI::Split::BEGIN@3
# spent 9µs making 1 call to strict::import |
| 4 | |||||
| 5 | 3 | 94µs | 2 | 179µs | # spent 98µs (18+80) within URI::Split::BEGIN@5 which was called:
# once (18µs+80µs) by C4::Koha::getitemtypeimagelocation at line 5 # spent 98µs making 1 call to URI::Split::BEGIN@5
# spent 80µs making 1 call to vars::import |
| 6 | 1 | 2µs | require Exporter; | ||
| 7 | 1 | 17µs | @ISA = qw(Exporter); | ||
| 8 | 1 | 1µs | @EXPORT_OK = qw(uri_split uri_join); | ||
| 9 | |||||
| 10 | 3 | 676µs | 1 | 9µs | # spent 9µs within URI::Split::BEGIN@10 which was called:
# once (9µs+0s) by C4::Koha::getitemtypeimagelocation at line 10 # spent 9µs making 1 call to URI::Split::BEGIN@10 |
| 11 | |||||
| 12 | # spent 3.47ms (1.34+2.13) within URI::Split::uri_split which was called 137 times, avg 25µs/call:
# 137 times (1.34ms+2.13ms) by C4::Koha::getitemtypeimagelocation at line 484 of /usr/share/koha/lib/C4/Koha.pm, avg 25µs/call | ||||
| 13 | 137 | 3.60ms | 137 | 2.13ms | return $_[0] =~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,; # spent 2.13ms making 137 calls to URI::Split::CORE:match, avg 16µs/call |
| 14 | } | ||||
| 15 | |||||
| 16 | sub uri_join { | ||||
| 17 | my($scheme, $auth, $path, $query, $frag) = @_; | ||||
| 18 | my $uri = defined($scheme) ? "$scheme:" : ""; | ||||
| 19 | $path = "" unless defined $path; | ||||
| 20 | if (defined $auth) { | ||||
| 21 | $auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg; | ||||
| 22 | $uri .= "//$auth"; | ||||
| 23 | $path = "/$path" if length($path) && $path !~ m,^/,; | ||||
| 24 | } | ||||
| 25 | elsif ($path =~ m,^//,) { | ||||
| 26 | $uri .= "//"; # XXX force empty auth | ||||
| 27 | } | ||||
| 28 | unless (length $uri) { | ||||
| 29 | $path =~ s,(:), URI::Escape::escape_char($1),e while $path =~ m,^[^:/?\#]+:,; | ||||
| 30 | } | ||||
| 31 | $path =~ s,([?\#]), URI::Escape::escape_char($1),eg; | ||||
| 32 | $uri .= $path; | ||||
| 33 | if (defined $query) { | ||||
| 34 | $query =~ s,(\#), URI::Escape::escape_char($1),eg; | ||||
| 35 | $uri .= "?$query"; | ||||
| 36 | } | ||||
| 37 | $uri .= "#$frag" if defined $frag; | ||||
| 38 | $uri; | ||||
| 39 | } | ||||
| 40 | |||||
| 41 | 1 | 7µs | 1; | ||
| 42 | |||||
| 43 | __END__ | ||||
# spent 2.13ms within URI::Split::CORE:match which was called 137 times, avg 16µs/call:
# 137 times (2.13ms+0s) by URI::Split::uri_split at line 13, avg 16µs/call |