Profile of Plack/Request/Upload.pm

← 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
Statements | Executed 7 statements in 262µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 9µs | 18µs | Plack::Request::Upload::::BEGIN@2Plack::Request::Upload::BEGIN@2
1 | 1 | 1 | 8µs | 16µs | Plack::Request::Upload::::BEGIN@3Plack::Request::Upload::BEGIN@3
1 | 1 | 1 | 3µs | 3µs | Plack::Request::Upload::::BEGIN@4Plack::Request::Upload::BEGIN@4
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::basenamePlack::Request::Upload::basename
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::content_typePlack::Request::Upload::content_type
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::filenamePlack::Request::Upload::filename
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::headersPlack::Request::Upload::headers
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::newPlack::Request::Upload::new
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::pathPlack::Request::Upload::path
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::sizePlack::Request::Upload::size
0 | 0 | 0 | 0s | 0s | Plack::Request::Upload::::tempnamePlack::Request::Upload::tempname
0 | 0 | 0 | 0s | 0s | Plack::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Plack::Request::Upload;
2 | 2 | 20µs | 2 | 27µ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
3 | 2 | 18µs | 2 | 24µ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
4 | 2 | 223µs | 1 | 3µ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 |  |  |  |  |
6 |  |  |  |  | sub 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 |  |  |  |  |
17 |  |  |  |  | sub filename { $_[0]->{filename} }
18 |  |  |  |  | sub headers { $_[0]->{headers} }
19 |  |  |  |  | sub size { $_[0]->{size} }
20 |  |  |  |  | sub tempname { $_[0]->{tempname} }
21 |  |  |  |  | sub path { $_[0]->{tempname} }
22 |  |  |  |  |
23 |  |  |  |  | sub content_type {
24 |  |  |  |  | my $self = shift;
25 |  |  |  |  | $self->{headers}->content_type(@_);
26 |  |  |  |  | }
27 |  |  |  |  |
28 |  |  |  |  | sub type { shift->content_type(@_) }
29 |  |  |  |  |
30 |  |  |  |  | sub 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 |  |  |  |  |
43 | 1 | 2µs |  |  | 1;
44 |  |  |  |  | __END__