← Index
NYTProf Performance Profile   « block view • line view • sub view »
For conv.pl
  Run on Sun Nov 14 21:09:12 2010
Reported on Sun Nov 14 21:13:15 2010

Filename/usr/lib/perl/5.10/IO/File.pm
StatementsExecuted 32 statements in 1.37ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111941µs5.41msIO::File::::BEGIN@11IO::File::BEGIN@11
111361µs551µsIO::File::::BEGIN@10IO::File::BEGIN@10
681195µs95µsIO::File::::CORE:matchIO::File::CORE:match (opcode)
11133µs33µsIO::File::::BEGIN@5IO::File::BEGIN@5
11119µs105µsIO::File::::BEGIN@9IO::File::BEGIN@9
11116µs97µsIO::File::::BEGIN@8IO::File::BEGIN@8
11115µs21µsIO::File::::BEGIN@6IO::File::BEGIN@6
11113µs13µsIO::File::::BEGIN@12IO::File::BEGIN@12
0000s0sIO::File::::binmodeIO::File::binmode
0000s0sIO::File::::newIO::File::new
0000s0sIO::File::::openIO::File::open
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#
2
3package IO::File;
4
5354µs133µs
# spent 33µs within IO::File::BEGIN@5 which was called: # once (33µs+0s) by Storable::BEGIN@23 at line 5
use 5.006_001;
# spent 33µs making 1 call to IO::File::BEGIN@5
6370µs227µs
# spent 21µs (15+6) within IO::File::BEGIN@6 which was called: # once (15µs+6µs) by Storable::BEGIN@23 at line 6
use strict;
# spent 21µs making 1 call to IO::File::BEGIN@6 # spent 6µs making 1 call to strict::import
711µsour($VERSION, @EXPORT, @EXPORT_OK, @ISA);
8340µs2178µs
# spent 97µs (16+81) within IO::File::BEGIN@8 which was called: # once (16µs+81µs) by Storable::BEGIN@23 at line 8
use Carp;
# spent 97µs making 1 call to IO::File::BEGIN@8 # spent 81µs making 1 call to Exporter::import
9344µs2191µs
# spent 105µs (19+86) within IO::File::BEGIN@9 which was called: # once (19µs+86µs) by Storable::BEGIN@23 at line 9
use Symbol;
# spent 105µs making 1 call to IO::File::BEGIN@9 # spent 86µs making 1 call to Exporter::import
103208µs1551µs
# spent 551µs (361+190) within IO::File::BEGIN@10 which was called: # once (361µs+190µs) by Storable::BEGIN@23 at line 10
use SelectSaver;
# spent 551µs making 1 call to IO::File::BEGIN@10
113159µs25.49ms
# spent 5.41ms (941µs+4.47) within IO::File::BEGIN@11 which was called: # once (941µs+4.47ms) by Storable::BEGIN@23 at line 11
use IO::Seekable;
# spent 5.41ms making 1 call to IO::File::BEGIN@11 # spent 72µs making 1 call to Exporter::import
123470µs113µs
# spent 13µs within IO::File::BEGIN@12 which was called: # once (13µs+0s) by Storable::BEGIN@23 at line 12
use File::Spec;
# spent 13µs making 1 call to IO::File::BEGIN@12
13
1411µsrequire Exporter;
15
16123µs@ISA = qw(IO::Handle IO::Seekable Exporter);
17
1812µs$VERSION = "1.14";
19
2012µs@EXPORT = @IO::Seekable::EXPORT;
21
225285µseval {
23 # Make all Fcntl O_XXX constants available for importing
24 require Fcntl;
256895µs my @O = grep /^O_/, @Fcntl::EXPORT;
# spent 95µs making 68 calls to IO::File::CORE:match, avg 1µs/call
261336µs Fcntl->import(@O); # first we import what we want to export
# spent 336µs making 1 call to Exporter::import
27 push(@EXPORT, @O);
28};
29
30################################################
31## Constructor
32##
33
34sub new {
35 my $type = shift;
36 my $class = ref($type) || $type || "IO::File";
37 @_ >= 0 && @_ <= 3
38 or croak "usage: new $class [FILENAME [,MODE [,PERMS]]]";
39 my $fh = $class->SUPER::new();
40 if (@_) {
41 $fh->open(@_)
42 or return undef;
43 }
44 $fh;
45}
46
47################################################
48## Open
49##
50
51sub open {
52 @_ >= 2 && @_ <= 4 or croak 'usage: $fh->open(FILENAME [,MODE [,PERMS]])';
53 my ($fh, $file) = @_;
54 if (@_ > 2) {
55 my ($mode, $perms) = @_[2, 3];
56 if ($mode =~ /^\d+$/) {
57 defined $perms or $perms = 0666;
58 return sysopen($fh, $file, $mode, $perms);
59 } elsif ($mode =~ /:/) {
60 return open($fh, $mode, $file) if @_ == 3;
61 croak 'usage: $fh->open(FILENAME, IOLAYERS)';
62 } else {
63 return open($fh, IO::Handle::_open_mode_string($mode), $file);
64 }
65 }
66 open($fh, $file);
67}
68
69################################################
70## Binmode
71##
72
73sub binmode {
74 ( @_ == 1 or @_ == 2 ) or croak 'usage $fh->binmode([LAYER])';
75
76 my($fh, $layer) = @_;
77
78 return binmode $$fh unless $layer;
79 return binmode $$fh, $layer;
80}
81
82112µs1;
 
# spent 95µs within IO::File::CORE:match which was called 68 times, avg 1µs/call: # 68 times (95µs+0s) by Storable::BEGIN@23 at line 25, avg 1µs/call
sub IO::File::CORE:match; # opcode