| Filename | /usr/share/perl5/URI/Split.pm |
| Statements | Executed 150 statements in 4.32ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 137 | 1 | 1 | 2.17ms | 2.17ms | URI::Split::CORE:match (opcode) |
| 137 | 1 | 1 | 1.38ms | 3.55ms | URI::Split::uri_split |
| 1 | 1 | 1 | 104µs | 104µs | URI::Split::BEGIN@10 |
| 1 | 1 | 1 | 30µs | 37µs | URI::Split::BEGIN@3 |
| 1 | 1 | 1 | 17µs | 121µs | URI::Split::BEGIN@5 |
| 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 | 47µs | 2 | 45µs | # spent 37µs (30+8) within URI::Split::BEGIN@3 which was called:
# once (30µs+8µs) by C4::Koha::getitemtypeimagelocation at line 3 # spent 37µs making 1 call to URI::Split::BEGIN@3
# spent 8µs making 1 call to strict::import |
| 4 | |||||
| 5 | 3 | 91µs | 2 | 225µs | # spent 121µs (17+104) within URI::Split::BEGIN@5 which was called:
# once (17µs+104µs) by C4::Koha::getitemtypeimagelocation at line 5 # spent 121µs making 1 call to URI::Split::BEGIN@5
# spent 104µs making 1 call to vars::import |
| 6 | 1 | 1µs | require Exporter; | ||
| 7 | 1 | 12µs | @ISA = qw(Exporter); | ||
| 8 | 1 | 900ns | @EXPORT_OK = qw(uri_split uri_join); | ||
| 9 | |||||
| 10 | 3 | 613µs | 1 | 104µs | # spent 104µs within URI::Split::BEGIN@10 which was called:
# once (104µs+0s) by C4::Koha::getitemtypeimagelocation at line 10 # spent 104µs making 1 call to URI::Split::BEGIN@10 |
| 11 | |||||
| 12 | # spent 3.55ms (1.38+2.17) within URI::Split::uri_split which was called 137 times, avg 26µs/call:
# 137 times (1.38ms+2.17ms) by C4::Koha::getitemtypeimagelocation at line 484 of /usr/share/koha/lib/C4/Koha.pm, avg 26µs/call | ||||
| 13 | 137 | 3.55ms | 137 | 2.17ms | return $_[0] =~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,; # spent 2.17ms 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 | 5µs | 1; | ||
| 42 | |||||
| 43 | __END__ | ||||
# spent 2.17ms within URI::Split::CORE:match which was called 137 times, avg 16µs/call:
# 137 times (2.17ms+0s) by URI::Split::uri_split at line 13, avg 16µs/call |