← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:15 2017

Filename/usr/local/perls/perl-5.26.1/lib/site_perl/5.26.1/URI/file/Unix.pm
StatementsExecuted 73 statements in 797µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
211135µs413µsURI::file::Unix::::fileURI::file::Unix::file
11159µs69µsURI::file::Unix::::BEGIN@3URI::file::Unix::BEGIN@3
11117µs40µsURI::file::Unix::::BEGIN@4URI::file::Unix::BEGIN@4
11115µs1.55msURI::file::Unix::::BEGIN@6URI::file::Unix::BEGIN@6
11115µs66µsURI::file::Unix::::BEGIN@8URI::file::Unix::BEGIN@8
402111µs11µsURI::file::Unix::::CORE:matchURI::file::Unix::CORE:match (opcode)
0000s0sURI::file::Unix::::_file_extract_pathURI::file::Unix::_file_extract_path
0000s0sURI::file::Unix::::_file_is_absoluteURI::file::Unix::_file_is_absolute
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package URI::file::Unix;
2
3256µs279µs
# spent 69µs (59+10) within URI::file::Unix::BEGIN@3 which was called: # once (59µs+10µs) by URI::file::os_class at line 3
use strict;
# spent 69µs making 1 call to URI::file::Unix::BEGIN@3 # spent 10µs making 1 call to strict::import
4249µs263µs
# spent 40µs (17+23) within URI::file::Unix::BEGIN@4 which was called: # once (17µs+23µs) by URI::file::os_class at line 4
use warnings;
# spent 40µs making 1 call to URI::file::Unix::BEGIN@4 # spent 23µs making 1 call to warnings::import
5
6254µs23.08ms
# spent 1.55ms (15µs+1.53) within URI::file::Unix::BEGIN@6 which was called: # once (15µs+1.53ms) by URI::file::os_class at line 6
use parent 'URI::file::Base';
# spent 1.55ms making 1 call to URI::file::Unix::BEGIN@6 # spent 1.53ms making 1 call to parent::import
7
82466µs2117µs
# spent 66µs (15+51) within URI::file::Unix::BEGIN@8 which was called: # once (15µs+51µs) by URI::file::os_class at line 8
use URI::Escape qw(uri_unescape);
# spent 66µs making 1 call to URI::file::Unix::BEGIN@8 # spent 51µs making 1 call to Exporter::import
9
1011µsour $VERSION = '1.72';
11125µs$VERSION = eval $VERSION;
# spent 3µs executing statements in string eval
12
13sub _file_extract_path
14{
15 my($class, $path) = @_;
16
17 # tidy path
18 $path =~ s,//+,/,g;
19 $path =~ s,(/\.)+/,/,g;
20 $path = "./$path" if $path =~ m,^[^:/]+:,,; # look like "scheme:"
21
22 return $path;
23}
24
25sub _file_is_absolute {
26 my($class, $path) = @_;
27 return $path =~ m,^/,;
28}
29
30sub file
31
# spent 413µs (135+278) within URI::file::Unix::file which was called 2 times, avg 206µs/call: # 2 times (135µs+278µs) by URI::file::file at line 96 of URI/file.pm, avg 206µs/call
{
3222µs my $class = shift;
3321µs my $uri = shift;
3420s my @path;
35
3624µs227µs my $auth = $uri->authority;
# spent 27µs making 2 calls to URI::_generic::authority, avg 14µs/call
3722µs if (defined($auth)) {
3823µs if (lc($auth) ne "localhost" && $auth ne "") {
39 $auth = uri_unescape($auth);
40 unless ($class->_file_is_localhost($auth)) {
41 push(@path, "", "", $auth);
42 }
43 }
44 }
45
46214µs2240µs my @ps = $uri->path_segments;
# spent 240µs making 2 calls to URI::_generic::path_segments, avg 120µs/call
4721µs shift @ps if @path;
4827µs push(@path, @ps);
49
5021µs for (@path) {
51 # Unix file/directory names are not allowed to contain '\0' or '/'
522044µs208µs return undef if /\0/;
# spent 8µs making 20 calls to URI::file::Unix::CORE:match, avg 400ns/call
532041µs203µs return undef if /\//; # should we really?
# spent 3µs making 20 calls to URI::file::Unix::CORE:match, avg 150ns/call
54 }
55
56221µs return join("/", @path);
57}
58
5915µs1;
 
# spent 11µs within URI::file::Unix::CORE:match which was called 40 times, avg 275ns/call: # 20 times (8µs+0s) by URI::file::Unix::file at line 52, avg 400ns/call # 20 times (3µs+0s) by URI::file::Unix::file at line 53, avg 150ns/call
sub URI::file::Unix::CORE:match; # opcode