← 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:47 2015

Filename/usr/share/perl/5.20/FileHandle.pm
StatementsExecuted 74 statements in 498µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs16µsFileHandle::::BEGIN@3FileHandle::BEGIN@3
11115µs306µsFileHandle::::importFileHandle::import
1117µs17µsFileHandle::::BEGIN@4FileHandle::BEGIN@4
1116µs14µsFileHandle::::BEGIN@46FileHandle::BEGIN@46
0000s0sFileHandle::::pipeFileHandle::pipe
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package FileHandle;
2
3240µs116µs
# spent 16µs within FileHandle::BEGIN@3 which was called: # once (16µs+0s) by Module::Load::Conditional::BEGIN@11 at line 3
use 5.006;
# spent 16µs making 1 call to FileHandle::BEGIN@3
42114µs228µs
# spent 17µs (7+10) within FileHandle::BEGIN@4 which was called: # once (7µs+10µs) by Module::Load::Conditional::BEGIN@11 at line 4
use strict;
# spent 17µs making 1 call to FileHandle::BEGIN@4 # spent 10µs making 1 call to strict::import
51300nsour($VERSION, @ISA, @EXPORT, @EXPORT_OK);
6
71500ns$VERSION = "2.02";
8
91600nsrequire IO::File;
1018µs@ISA = qw(IO::File);
11
121600ns@EXPORT = qw(_IOFBF _IOLBF _IONBF);
13
1411µs@EXPORT_OK = qw(
15 pipe
16
17 autoflush
18 output_field_separator
19 output_record_separator
20 input_record_separator
21 input_line_number
22 format_page_number
23 format_lines_per_page
24 format_lines_left
25 format_name
26 format_top_name
27 format_line_break_characters
28 format_formfeed
29
30 print
31 printf
32 getline
33 getlines
34);
35
36#
37# Everything we're willing to export, we must first import.
38#
39121µs1107µsimport IO::Handle grep { !defined(&$_) } @EXPORT, @EXPORT_OK;
# spent 107µs making 1 call to Exporter::import
40
41#
42# Some people call "FileHandle::function", so all the functions
43# that were in the old FileHandle class must be imported, too.
44#
45{
463235µs222µs
# spent 14µs (6+8) within FileHandle::BEGIN@46 which was called: # once (6µs+8µs) by Module::Load::Conditional::BEGIN@11 at line 46
no strict 'refs';
# spent 14µs making 1 call to FileHandle::BEGIN@46 # spent 8µs making 1 call to strict::unimport
47
4814µs my %import = (
49 'IO::Handle' =>
50 [qw(DESTROY new_from_fd fdopen close fileno getc ungetc gets
51 eof flush error clearerr setbuf setvbuf _open_mode_string)],
52 'IO::Seekable' =>
53 [qw(seek tell getpos setpos)],
54 'IO::File' =>
55 [qw(new new_tmpfile open)]
56 );
5712µs for my $pkg (keys %import) {
5832µs for my $func (@{$import{$pkg}}) {
592220µs my $c = *{"${pkg}::$func"}{CODE}
60 or die "${pkg}::$func missing";
612228µs *$func = $c;
62 }
63 }
64}
65
66#
67# Specialized importer for Fcntl magic.
68#
69
# spent 306µs (15+292) within FileHandle::import which was called: # once (15µs+292µs) by MIME::Lite::BEGIN@339 at line 339 of MIME/Lite.pm
sub import {
701500ns my $pkg = shift;
711700ns my $callpkg = caller;
721600ns require Exporter;
7312µs115µs Exporter::export($pkg, $callpkg, @_);
# spent 15µs making 1 call to Exporter::export
74
75 #
76 # If the Fcntl extension is available,
77 # export its constants.
78 #
7914µs eval {
801500ns require Fcntl;
8111µs19µs Exporter::export('Fcntl', $callpkg);
# spent 9µs making 1 call to Exporter::export
82 };
83}
84
85################################################
86# This is the only exported function we define;
87# the rest come from other classes.
88#
89
90sub pipe {
91 my $r = new IO::Handle;
92 my $w = new IO::Handle;
93 CORE::pipe($r, $w) or return undef;
94 ($r, $w);
95}
96
97# Rebless standard file handles
981700nsbless *STDIN{IO}, "FileHandle" if ref *STDIN{IO} eq "IO::Handle";
991400nsbless *STDOUT{IO}, "FileHandle" if ref *STDOUT{IO} eq "IO::Handle";
1001400nsbless *STDERR{IO}, "FileHandle" if ref *STDERR{IO} eq "IO::Handle";
101
102111µs1;
103
104__END__