← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:09 2016

Filename/usr/local/share/perl/5.18.2/Plack/Request/Upload.pm
StatementsExecuted 7 statements in 262µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs18µsPlack::Request::Upload::::BEGIN@2Plack::Request::Upload::BEGIN@2
1118µs16µsPlack::Request::Upload::::BEGIN@3Plack::Request::Upload::BEGIN@3
1113µs3µsPlack::Request::Upload::::BEGIN@4Plack::Request::Upload::BEGIN@4
0000s0sPlack::Request::Upload::::basenamePlack::Request::Upload::basename
0000s0sPlack::Request::Upload::::content_typePlack::Request::Upload::content_type
0000s0sPlack::Request::Upload::::filenamePlack::Request::Upload::filename
0000s0sPlack::Request::Upload::::headersPlack::Request::Upload::headers
0000s0sPlack::Request::Upload::::newPlack::Request::Upload::new
0000s0sPlack::Request::Upload::::pathPlack::Request::Upload::path
0000s0sPlack::Request::Upload::::sizePlack::Request::Upload::size
0000s0sPlack::Request::Upload::::tempnamePlack::Request::Upload::tempname
0000s0sPlack::Request::Upload::::typePlack::Request::Upload::type
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Plack::Request::Upload;
2220µs227µs
# spent 18µs (9+9) within Plack::Request::Upload::BEGIN@2 which was called: # once (9µs+9µs) by Plack::Request::BEGIN@12 at line 2
use strict;
# spent 18µs making 1 call to Plack::Request::Upload::BEGIN@2 # spent 9µs making 1 call to strict::import
3218µs224µs
# spent 16µs (8+8) within Plack::Request::Upload::BEGIN@3 which was called: # once (8µs+8µs) by Plack::Request::BEGIN@12 at line 3
use warnings;
# spent 16µs making 1 call to Plack::Request::Upload::BEGIN@3 # spent 8µs making 1 call to warnings::import
42223µs13µs
# spent 3µs within Plack::Request::Upload::BEGIN@4 which was called: # once (3µs+0s) by Plack::Request::BEGIN@12 at line 4
use Carp ();
# spent 3µs making 1 call to Plack::Request::Upload::BEGIN@4
5
6sub new {
7 my($class, %args) = @_;
8
9 bless {
10 headers => $args{headers},
11 tempname => $args{tempname},
12 size => $args{size},
13 filename => $args{filename},
14 }, $class;
15}
16
17sub filename { $_[0]->{filename} }
18sub headers { $_[0]->{headers} }
19sub size { $_[0]->{size} }
20sub tempname { $_[0]->{tempname} }
21sub path { $_[0]->{tempname} }
22
23sub content_type {
24 my $self = shift;
25 $self->{headers}->content_type(@_);
26}
27
28sub type { shift->content_type(@_) }
29
30sub basename {
31 my $self = shift;
32 unless (defined $self->{basename}) {
33 require File::Spec::Unix;
34 my $basename = $self->{filename};
35 $basename =~ s|\\|/|g;
36 $basename = ( File::Spec::Unix->splitpath($basename) )[2];
37 $basename =~ s|[^\w\.-]+|_|g;
38 $self->{basename} = $basename;
39 }
40 $self->{basename};
41}
42
4312µs1;
44__END__