Profile of HTTP/Body/OctetStream.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/HTTP/Body/OctetStream.pm
Statements | Executed 12 statements in 411µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 180µs | 182µs | HTTP::Body::OctetStream::::BEGIN@8HTTP::Body::OctetStream::BEGIN@8
1 | 1 | 1 | 26µs | 140µs | HTTP::Body::OctetStream::::BEGIN@10HTTP::Body::OctetStream::BEGIN@10
1 | 1 | 1 | 14µs | 32µs | HTTP::Body::OctetStream::::BEGIN@6HTTP::Body::OctetStream::BEGIN@6
1 | 1 | 1 | 8µs | 86µs | HTTP::Body::OctetStream::::BEGIN@7HTTP::Body::OctetStream::BEGIN@7
0 | 0 | 0 | 0s | 0s | HTTP::Body::OctetStream::::spinHTTP::Body::OctetStream::spin

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package HTTP::Body::OctetStream;
2 |  |  |  |  | {
3 | 2 | 1µs |  |  | $HTTP::Body::OctetStream::VERSION = '1.19';
4 |  |  |  |  | }
5 |  |  |  |  |
6 | 2 | 27µs | 2 | 50µs | # spent 32µs (14+18) within HTTP::Body::OctetStream::BEGIN@6 which was called: # once (14µs+18µs) by Plack::Request::BEGIN@10 at line 6 use strict; # spent 32µs making 1 call to HTTP::Body::OctetStream::BEGIN@6 # spent 18µs making 1 call to strict::import
7 | 2 | 28µs | 2 | 164µs | # spent 86µs (8+78) within HTTP::Body::OctetStream::BEGIN@7 which was called: # once (8µs+78µs) by Plack::Request::BEGIN@10 at line 7 use base 'HTTP::Body'; # spent 86µs making 1 call to HTTP::Body::OctetStream::BEGIN@7 # spent 78µs making 1 call to base::import
8 | 2 | 198µs | 2 | 184µs | # spent 182µs (180+2) within HTTP::Body::OctetStream::BEGIN@8 which was called: # once (180µs+2µs) by Plack::Request::BEGIN@10 at line 8 use bytes; # spent 182µs making 1 call to HTTP::Body::OctetStream::BEGIN@8 # spent 2µs making 1 call to bytes::import
9 |  |  |  |  |
10 | 3 | 155µs | 3 | 254µs | # spent 140µs (26+114) within HTTP::Body::OctetStream::BEGIN@10 which was called: # once (26µs+114µs) by Plack::Request::BEGIN@10 at line 10 use File::Temp 0.14; # spent 140µs making 1 call to HTTP::Body::OctetStream::BEGIN@10 # spent 101µs making 1 call to Exporter::import # spent 13µs making 1 call to UNIVERSAL::VERSION
11 |  |  |  |  |
12 |  |  |  |  | =head1 NAME
13 |  |  |  |  |
14 |  |  |  |  | HTTP::Body::OctetStream - HTTP Body OctetStream Parser
15 |  |  |  |  |
16 |  |  |  |  | =head1 SYNOPSIS
17 |  |  |  |  |
18 |  |  |  |  | use HTTP::Body::OctetStream;
19 |  |  |  |  |
20 |  |  |  |  | =head1 DESCRIPTION
21 |  |  |  |  |
22 |  |  |  |  | HTTP Body OctetStream Parser.
23 |  |  |  |  |
24 |  |  |  |  | =head1 METHODS
25 |  |  |  |  |
26 |  |  |  |  | =over 4
27 |  |  |  |  |
28 |  |  |  |  | =item spin
29 |  |  |  |  |
30 |  |  |  |  | =cut
31 |  |  |  |  |
32 |  |  |  |  | sub spin {
33 |  |  |  |  | my $self = shift;
34 |  |  |  |  |
35 |  |  |  |  | unless ( $self->body ) {
36 |  |  |  |  | $self->body( File::Temp->new( DIR => $self->tmpdir ) );
37 |  |  |  |  | }
38 |  |  |  |  |
39 |  |  |  |  | if ( my $length = length( $self->{buffer} ) ) {
40 |  |  |  |  | $self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length );
41 |  |  |  |  | }
42 |  |  |  |  |
43 |  |  |  |  | if ( $self->length == $self->content_length ) {
44 |  |  |  |  | seek( $self->body, 0, 0 );
45 |  |  |  |  | $self->state('done');
46 |  |  |  |  | }
47 |  |  |  |  | }
48 |  |  |  |  |
49 |  |  |  |  | =back
50 |  |  |  |  |
51 |  |  |  |  | =head1 AUTHOR
52 |  |  |  |  |
53 |  |  |  |  | Christian Hansen, C<ch@ngmedia.com>
54 |  |  |  |  |
55 |  |  |  |  | =head1 LICENSE
56 |  |  |  |  |
57 |  |  |  |  | This library is free software . You can redistribute it and/or modify
58 |  |  |  |  | it under the same terms as perl itself.
59 |  |  |  |  |
60 |  |  |  |  | =cut
61 |  |  |  |  |
62 | 1 | 2µs |  |  | 1;