← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:12:14 2013

Filename/usr/share/perl/5.10/FileHandle.pm
StatementsExecuted 84 statements in 741µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
22262µs3.73msFileHandle::::importFileHandle::import
11125µs25µsFileHandle::::BEGIN@3FileHandle::BEGIN@3
11117µs30µsFileHandle::::BEGIN@46FileHandle::BEGIN@46
1119µs13µsFileHandle::::BEGIN@4FileHandle::BEGIN@4
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
3341µs125µs
# spent 25µs within FileHandle::BEGIN@3 which was called: # once (25µs+0s) by Storable::BEGIN@23 at line 3
use 5.006;
# spent 25µs making 1 call to FileHandle::BEGIN@3
43133µs217µs
# spent 13µs (9+4) within FileHandle::BEGIN@4 which was called: # once (9µs+4µs) by Storable::BEGIN@23 at line 4
use strict;
# spent 13µs making 1 call to FileHandle::BEGIN@4 # spent 4µs making 1 call to strict::import
51800nsour($VERSION, @ISA, @EXPORT, @EXPORT_OK);
6
71700ns$VERSION = "2.02";
8
9187µsrequire IO::File;
10114µs@ISA = qw(IO::File);
11
1213µs@EXPORT = qw(_IOFBF _IOLBF _IONBF);
13
1417µ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#
39124µs1194µsimport IO::Handle grep { !defined(&$_) } @EXPORT, @EXPORT_OK;
# spent 194µ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{
464253µs243µs
# spent 30µs (17+13) within FileHandle::BEGIN@46 which was called: # once (17µs+13µs) by Storable::BEGIN@23 at line 46
no strict 'refs';
# spent 30µs making 1 call to FileHandle::BEGIN@46 # spent 13µs making 1 call to strict::unimport
47
4818µ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 );
5717µs for my $pkg (keys %import) {
5835µs for my $func (@{$import{$pkg}}) {
592231µs my $c = *{"${pkg}::$func"}{CODE}
60 or die "${pkg}::$func missing";
612243µs *$func = $c;
62 }
63 }
64}
65
66#
67# Specialized importer for Fcntl magic.
68#
69
# spent 3.73ms (62µs+3.67) within FileHandle::import which was called 2 times, avg 1.86ms/call: # once (44µs+3.15ms) by Storable::BEGIN@23 at line 23 of Storable.pm # once (18µs+517µs) by MIME::Lite::BEGIN@331 at line 331 of MIME/Lite.pm
sub import {
7023µs my $pkg = shift;
7122µs my $callpkg = caller;
7222µs require Exporter;
7325µs22.19ms Exporter::export($pkg, $callpkg, @_);
# spent 2.19ms making 2 calls to Exporter::export, avg 1.10ms/call
74
75 #
76 # If the Fcntl extension is available,
77 # export its constants.
78 #
79214µs eval {
8022µs require Fcntl;
8127µs240µs Exporter::export('Fcntl', $callpkg);
# spent 40µs making 2 calls to Exporter::export, avg 20µs/call
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
98114µsbless *STDIN{IO}, "FileHandle" if ref *STDIN{IO} eq "IO::Handle";
9914µsbless *STDOUT{IO}, "FileHandle" if ref *STDOUT{IO} eq "IO::Handle";
10017µsbless *STDERR{IO}, "FileHandle" if ref *STDERR{IO} eq "IO::Handle";
101
102126µs1;
103
104__END__