← 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
StatementsExecuted 12 statements in 411µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111180µs182µsHTTP::Body::OctetStream::::BEGIN@8HTTP::Body::OctetStream::BEGIN@8
11126µs140µsHTTP::Body::OctetStream::::BEGIN@10HTTP::Body::OctetStream::BEGIN@10
11114µs32µsHTTP::Body::OctetStream::::BEGIN@6HTTP::Body::OctetStream::BEGIN@6
1118µs86µsHTTP::Body::OctetStream::::BEGIN@7HTTP::Body::OctetStream::BEGIN@7
0000s0sHTTP::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
1package HTTP::Body::OctetStream;
2{
321µs $HTTP::Body::OctetStream::VERSION = '1.19';
4}
5
6227µs250µ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
7228µs2164µ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
82198µs2184µ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
103155µs3254µ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
14HTTP::Body::OctetStream - HTTP Body OctetStream Parser
15
16=head1 SYNOPSIS
17
18 use HTTP::Body::OctetStream;
19
20=head1 DESCRIPTION
21
22HTTP Body OctetStream Parser.
23
24=head1 METHODS
25
26=over 4
27
28=item spin
29
30=cut
31
32sub 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
53Christian Hansen, C<ch@ngmedia.com>
54
55=head1 LICENSE
56
57This library is free software . You can redistribute it and/or modify
58it under the same terms as perl itself.
59
60=cut
61
6212µs1;