← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:46 2015

Filename/usr/lib/x86_64-linux-gnu/perl/5.20/IO/File.pm
StatementsExecuted 43 statements in 6.08ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1118.64ms9.01msIO::File::::BEGIN@8IO::File::BEGIN@8
1112.40ms2.47msIO::File::::BEGIN@9IO::File::BEGIN@9
1111.53ms10.6msIO::File::::BEGIN@11IO::File::BEGIN@11
1111.48ms1.59msIO::File::::BEGIN@10IO::File::BEGIN@10
11177µs95µsIO::File::::BEGIN@6IO::File::BEGIN@6
21134µs34µsIO::File::::CORE:openIO::File::CORE:open (opcode)
11126µs26µsIO::File::::BEGIN@5IO::File::BEGIN@5
681122µs22µsIO::File::::CORE:matchIO::File::CORE:match (opcode)
21121µs50µsIO::File::::newIO::File::new
21118µs51µsIO::File::::openIO::File::open
0000s0sIO::File::::binmodeIO::File::binmode
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
5266µs126µs
# spent 26µs within IO::File::BEGIN@5 which was called: # once (26µs+0s) by Modern::Perl::BEGIN@16 at line 5
use 5.006_001;
# spent 26µs making 1 call to IO::File::BEGIN@5
6274µs2113µs
# spent 95µs (77+18) within IO::File::BEGIN@6 which was called: # once (77µs+18µs) by Modern::Perl::BEGIN@16 at line 6
use strict;
# spent 95µs making 1 call to IO::File::BEGIN@6 # spent 18µs making 1 call to strict::import
71600nsour($VERSION, @EXPORT, @EXPORT_OK, @ISA);
821.49ms29.08ms
# spent 9.01ms (8.64+371µs) within IO::File::BEGIN@8 which was called: # once (8.64ms+371µs) by Modern::Perl::BEGIN@16 at line 8
use Carp;
# spent 9.01ms making 1 call to IO::File::BEGIN@8 # spent 64µs making 1 call to Exporter::import
921.30ms22.52ms
# spent 2.47ms (2.40+69µs) within IO::File::BEGIN@9 which was called: # once (2.40ms+69µs) by Modern::Perl::BEGIN@16 at line 9
use Symbol;
# spent 2.47ms making 1 call to IO::File::BEGIN@9 # spent 46µs making 1 call to Exporter::import
1021.33ms11.59ms
# spent 1.59ms (1.48+115µs) within IO::File::BEGIN@10 which was called: # once (1.48ms+115µs) by Modern::Perl::BEGIN@16 at line 10
use SelectSaver;
# spent 1.59ms making 1 call to IO::File::BEGIN@10
1121.61ms210.7ms
# spent 10.6ms (1.53+9.10) within IO::File::BEGIN@11 which was called: # once (1.53ms+9.10ms) by Modern::Perl::BEGIN@16 at line 11
use IO::Seekable;
# spent 10.6ms making 1 call to IO::File::BEGIN@11 # spent 36µs making 1 call to Exporter::import
12
131900nsrequire Exporter;
14
15112µs@ISA = qw(IO::Handle IO::Seekable Exporter);
16
171300ns$VERSION = "1.16";
18
1911µs@EXPORT = @IO::Seekable::EXPORT;
20
211600nseval {
22 # Make all Fcntl O_XXX constants available for importing
231500ns require Fcntl;
241106µs6822µs my @O = grep /^O_/, @Fcntl::EXPORT;
# spent 22µs making 68 calls to IO::File::CORE:match, avg 318ns/call
2513µs1138µs Fcntl->import(@O); # first we import what we want to export
# spent 138µs making 1 call to Exporter::import
2616µs push(@EXPORT, @O);
27};
28
29################################################
30## Constructor
31##
32
33
# spent 50µs (21+29) within IO::File::new which was called 2 times, avg 25µs/call: # 2 times (21µs+29µs) by Date::Manip::TZ::_get_curr_zone at line 470 of Date/Manip/TZ.pm, avg 25µs/call
sub new {
3421µs my $type = shift;
3521µs my $class = ref($type) || $type || "IO::File";
3622µs @_ >= 0 && @_ <= 3
37 or croak "usage: $class->new([FILENAME [,MODE [,PERMS]]])";
3828µs229µs my $fh = $class->SUPER::new();
# spent 29µs making 2 calls to IO::Handle::new, avg 15µs/call
392800ns if (@_) {
40 $fh->open(@_)
41 or return undef;
42 }
4324µs $fh;
44}
45
46################################################
47## Open
48##
49
50
# spent 51µs (18+34) within IO::File::open which was called 2 times, avg 26µs/call: # 2 times (18µs+34µs) by Date::Manip::TZ::_get_curr_zone at line 471 of Date/Manip/TZ.pm, avg 26µs/call
sub open {
5122µs @_ >= 2 && @_ <= 4 or croak 'usage: $fh->open(FILENAME [,MODE [,PERMS]])';
5221µs my ($fh, $file) = @_;
532800ns if (@_ > 2) {
54 my ($mode, $perms) = @_[2, 3];
55 if ($mode =~ /^\d+$/) {
56 defined $perms or $perms = 0666;
57 return sysopen($fh, $file, $mode, $perms);
58 } elsif ($mode =~ /:/) {
59 return open($fh, $mode, $file) if @_ == 3;
60 croak 'usage: $fh->open(FILENAME, IOLAYERS)';
61 } else {
62 return open($fh, IO::Handle::_open_mode_string($mode), $file);
63 }
64 }
65249µs234µs open($fh, $file);
# spent 34µs making 2 calls to IO::File::CORE:open, avg 17µs/call
66}
67
68################################################
69## Binmode
70##
71
72sub binmode {
73 ( @_ == 1 or @_ == 2 ) or croak 'usage $fh->binmode([LAYER])';
74
75 my($fh, $layer) = @_;
76
77 return binmode $$fh unless $layer;
78 return binmode $$fh, $layer;
79}
80
8118µs1;
 
# spent 22µs within IO::File::CORE:match which was called 68 times, avg 318ns/call: # 68 times (22µs+0s) by Modern::Perl::BEGIN@16 at line 24, avg 318ns/call
sub IO::File::CORE:match; # opcode
# spent 34µs within IO::File::CORE:open which was called 2 times, avg 17µs/call: # 2 times (34µs+0s) by IO::File::open at line 65, avg 17µs/call
sub IO::File::CORE:open; # opcode