← Index
NYTProf Performance Profile   « block view • line view • sub view »
For conv.pl
  Run on Sun Nov 14 22:50:31 2010
Reported on Sun Nov 14 22:51:24 2010

Filename/usr/lib/perl/5.10/IO/File.pm
StatementsExecuted 32 statements in 1.22ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111534µs838µsIO::File::::BEGIN@11IO::File::BEGIN@11
681180µs80µsIO::File::::CORE:matchIO::File::CORE:match (opcode)
11131µs31µsIO::File::::BEGIN@5IO::File::BEGIN@5
11117µs104µsIO::File::::BEGIN@9IO::File::BEGIN@9
11115µs22µsIO::File::::BEGIN@6IO::File::BEGIN@6
11114µs14µsIO::File::::BEGIN@12IO::File::BEGIN@12
11114µs86µsIO::File::::BEGIN@8IO::File::BEGIN@8
11113µs13µsIO::File::::BEGIN@10IO::File::BEGIN@10
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µs131µs
# spent 31µs within IO::File::BEGIN@5 which was called: # once (31µs+0s) by Storable::BEGIN@23 at line 5
use 5.006_001;
# spent 31µs making 1 call to IO::File::BEGIN@5
6363µs229µs
# spent 22µs (15+7) within IO::File::BEGIN@6 which was called: # once (15µs+7µs) by Storable::BEGIN@23 at line 6
use strict;
# spent 22µs making 1 call to IO::File::BEGIN@6 # spent 7µs making 1 call to strict::import
711µsour($VERSION, @EXPORT, @EXPORT_OK, @ISA);
8339µs2158µs
# spent 86µs (14+72) within IO::File::BEGIN@8 which was called: # once (14µs+72µs) by Storable::BEGIN@23 at line 8
use Carp;
# spent 86µs making 1 call to IO::File::BEGIN@8 # spent 72µs making 1 call to Exporter::import
9342µs2191µs
# spent 104µs (17+87) within IO::File::BEGIN@9 which was called: # once (17µs+87µs) by Storable::BEGIN@23 at line 9
use Symbol;
# spent 104µs making 1 call to IO::File::BEGIN@9 # spent 87µs making 1 call to Exporter::import
10339µs113µs
# spent 13µs within IO::File::BEGIN@10 which was called: # once (13µs+0s) by Storable::BEGIN@23 at line 10
use SelectSaver;
# spent 13µs making 1 call to IO::File::BEGIN@10
113170µs2909µs
# spent 838µs (534+304) within IO::File::BEGIN@11 which was called: # once (534µs+304µs) by Storable::BEGIN@23 at line 11
use IO::Seekable;
# spent 838µs making 1 call to IO::File::BEGIN@11 # spent 71µs making 1 call to Exporter::import
123489µs114µs
# spent 14µs within IO::File::BEGIN@12 which was called: # once (14µs+0s) by Storable::BEGIN@23 at line 12
use File::Spec;
# spent 14µs making 1 call to IO::File::BEGIN@12
13
1411µsrequire Exporter;
15
16124µs@ISA = qw(IO::Handle IO::Seekable Exporter);
17
1812µs$VERSION = "1.14";
19
2012µs@EXPORT = @IO::Seekable::EXPORT;
21
2213µseval {
23 # Make all Fcntl O_XXX constants available for importing
2412µs require Fcntl;
251258µs6880µs my @O = grep /^O_/, @Fcntl::EXPORT;
# spent 80µs making 68 calls to IO::File::CORE:match, avg 1µs/call
2616µs1333µs Fcntl->import(@O); # first we import what we want to export
# spent 333µs making 1 call to Exporter::import
27113µs 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
82113µs1;
 
# spent 80µs within IO::File::CORE:match which was called 68 times, avg 1µs/call: # 68 times (80µs+0s) by Storable::BEGIN@23 at line 25, avg 1µs/call
sub IO::File::CORE:match; # opcode