← 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/Stream/Buffered.pm
StatementsExecuted 15 statements in 479µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111506µs985µsStream::Buffered::::BEGIN@5Stream::Buffered::BEGIN@5
111232µs317µsStream::Buffered::::BEGIN@6Stream::Buffered::BEGIN@6
111211µs398µsStream::Buffered::::BEGIN@7Stream::Buffered::BEGIN@7
111188µs268µsStream::Buffered::::BEGIN@8Stream::Buffered::BEGIN@8
11119µs28µsStream::Buffered::::BEGIN@3Stream::Buffered::BEGIN@3
1118µs26µsStream::Buffered::::BEGIN@2Stream::Buffered::BEGIN@2
0000s0sStream::Buffered::::createStream::Buffered::create
0000s0sStream::Buffered::::newStream::Buffered::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Stream::Buffered;
2229µs245µs
# spent 26µs (8+19) within Stream::Buffered::BEGIN@2 which was called: # once (8µs+19µs) by Plack::Request::BEGIN@13 at line 2
use strict;
# spent 26µs making 1 call to Stream::Buffered::BEGIN@2 # spent 19µs making 1 call to strict::import
3222µs236µs
# spent 28µs (19+8) within Stream::Buffered::BEGIN@3 which was called: # once (19µs+8µs) by Plack::Request::BEGIN@13 at line 3
use warnings;
# spent 28µs making 1 call to Stream::Buffered::BEGIN@3 # spent 8µs making 1 call to warnings::import
4
5296µs21.30ms
# spent 985µs (506+479) within Stream::Buffered::BEGIN@5 which was called: # once (506µs+479µs) by Plack::Request::BEGIN@13 at line 5
use FileHandle; # for seek etc.
# spent 985µs making 1 call to Stream::Buffered::BEGIN@5 # spent 311µs making 1 call to FileHandle::import
6270µs1317µs
# spent 317µs (232+84) within Stream::Buffered::BEGIN@6 which was called: # once (232µs+84µs) by Plack::Request::BEGIN@13 at line 6
use Stream::Buffered::Auto;
# spent 317µs making 1 call to Stream::Buffered::BEGIN@6
7269µs1398µs
# spent 398µs (211+187) within Stream::Buffered::BEGIN@7 which was called: # once (211µs+187µs) by Plack::Request::BEGIN@13 at line 7
use Stream::Buffered::File;
# spent 398µs making 1 call to Stream::Buffered::BEGIN@7
82190µs1268µs
# spent 268µs (188+80) within Stream::Buffered::BEGIN@8 which was called: # once (188µs+80µs) by Plack::Request::BEGIN@13 at line 8
use Stream::Buffered::PerlIO;
# spent 268µs making 1 call to Stream::Buffered::BEGIN@8
9
101200nsour $VERSION = 0.03;
11
121100nsour $MaxMemoryBufferSize = 1024 * 1024;
13
14sub new {
15 my($class, $length) = @_;
16
17 # $MaxMemoryBufferSize = 0 -> Always temp file
18 # $MaxMemoryBufferSize = -1 -> Always PerlIO
19 my $backend;
20 if ($MaxMemoryBufferSize < 0) {
21 $backend = "PerlIO";
22 } elsif ($MaxMemoryBufferSize == 0) {
23 $backend = "File";
24 } elsif (!$length) {
25 $backend = "Auto";
26 } elsif ($length > $MaxMemoryBufferSize) {
27 $backend = "File";
28 } else {
29 $backend = "PerlIO";
30 }
31
32 $class->create($backend, $length, $MaxMemoryBufferSize);
33}
34
35sub create {
36 my($class, $backend, $length, $max) = @_;
37 (__PACKAGE__ . "::$backend")->new($length, $max);
38}
39
40sub print;
41sub rewind;
42sub size;
43
4412µs1;
45
46__END__