← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:37 2012

Filename/usr/lib/perl5/5.14/constant.pm
StatementsExecuted 2751 statements in 8.07ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10910964.61ms5.75msconstant::::importconstant::import
11241313µs313µsconstant::::CORE:regcompconstant::CORE:regcomp (opcode)
10911293µs293µsconstant::::CORE:matchconstant::CORE:match (opcode)
111239µs239µsconstant::::BEGIN@2constant::BEGIN@2
11123µs23µsconstant::::BEGIN@25constant::BEGIN@25
33118µs18µsconstant::::CORE:qrconstant::CORE:qr (opcode)
11116µs82µsconstant::::BEGIN@6constant::BEGIN@6
11115µs20µsconstant::::BEGIN@3constant::BEGIN@3
11114µs209µsconstant::::BEGIN@4constant::BEGIN@4
11113µs30µsconstant::::BEGIN@114constant::BEGIN@114
11112µs29µsconstant::::BEGIN@52constant::BEGIN@52
11112µs31µsconstant::::BEGIN@29constant::BEGIN@29
0000s0sconstant::::__ANON__[:136]constant::__ANON__[:136]
0000s0sconstant::::__ANON__[:140]constant::__ANON__[:140]
0000s0sconstant::::__ANON__[:142]constant::__ANON__[:142]
0000s0sconstant::::__ANON__[:31]constant::__ANON__[:31]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package constant;
22194µs1239µs
# spent 239µs within constant::BEGIN@2 which was called: # once (239µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 2
use 5.005;
# spent 239µs making 1 call to constant::BEGIN@2
3256µs224µs
# spent 20µs (15+5) within constant::BEGIN@3 which was called: # once (15µs+5µs) by Compress::Raw::Zlib::BEGIN@71 at line 3
use strict;
# spent 20µs making 1 call to constant::BEGIN@3 # spent 5µs making 1 call to strict::import
4260µs2404µs
# spent 209µs (14+195) within constant::BEGIN@4 which was called: # once (14µs+195µs) by Compress::Raw::Zlib::BEGIN@71 at line 4
use warnings::register;
# spent 209µs making 1 call to constant::BEGIN@4 # spent 195µs making 1 call to warnings::register::import
5
62252µs2147µs
# spent 82µs (16+66) within constant::BEGIN@6 which was called: # once (16µs+66µs) by Compress::Raw::Zlib::BEGIN@71 at line 6
use vars qw($VERSION %declared);
# spent 82µs making 1 call to constant::BEGIN@6 # spent 66µs making 1 call to vars::import
711µs$VERSION = '1.21';
8
9#=======================================================================
10
11# Some names are evil choices.
12112µsmy %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD };
1312µs$keywords{UNITCHECK}++ if $] > 5.009;
14
15113µsmy %forced_into_main = map +($_, 1),
16 qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG };
17
1819µsmy %forbidden = (%keywords, %forced_into_main);
19
2012µsmy $str_end = $] >= 5.006 ? "\\z" : "\\Z";
21152µs236µsmy $normal_constant_name = qr/^_?[^\W_0-9]\w*$str_end/;
# spent 24µs making 1 call to constant::CORE:regcomp # spent 12µs making 1 call to constant::CORE:qr
22122µs214µsmy $tolerable = qr/^[A-Za-z_]\w*$str_end/;
# spent 11µs making 1 call to constant::CORE:regcomp # spent 3µs making 1 call to constant::CORE:qr
23121µs213µsmy $boolean = qr/^[01]?$str_end/;
# spent 10µs making 1 call to constant::CORE:regcomp # spent 3µs making 1 call to constant::CORE:qr
24
25
# spent 23µs within constant::BEGIN@25 which was called: # once (23µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 32
BEGIN {
26 # We'd like to do use constant _CAN_PCS => $] > 5.009002
27 # but that's a bit tricky before we load the constant module :-)
28 # By doing this, we save 1 run time check for *every* call to import.
29292µs250µs
# spent 31µs (12+19) within constant::BEGIN@29 which was called: # once (12µs+19µs) by Compress::Raw::Zlib::BEGIN@71 at line 29
no strict 'refs';
# spent 31µs making 1 call to constant::BEGIN@29 # spent 19µs making 1 call to strict::unimport
30224µs my $const = $] > 5.009002;
31 *_CAN_PCS = sub () {$const};
321136µs123µs}
# spent 23µs making 1 call to constant::BEGIN@25
33
34#=======================================================================
35# import() - import symbols into user's namespace
36#
37# What we actually do is define a function in the caller's namespace
38# which returns the value. The function we create will normally
39# be inlined as a constant, thereby avoiding further sub calling
40# overhead.
41#=======================================================================
42
# spent 5.75ms (4.61+1.14) within constant::import which was called 109 times, avg 53µs/call: # once (116µs+35µs) by Archive::Zip::BEGIN@158 at line 158 of Archive/Zip.pm # once (68µs+23µs) by Compress::Raw::Zlib::BEGIN@71 at line 71 of Compress/Raw/Zlib.pm # once (60µs+19µs) by File::stat::BEGIN@143 at line 143 of File/stat.pm # once (59µs+19µs) by Archive::Zip::BEGIN@149 at line 149 of Archive/Zip.pm # once (61µs+16µs) by Time::Local::BEGIN@27 at line 27 of Time/Local.pm # once (57µs+17µs) by File::Temp::BEGIN@217 at line 217 of File/Temp.pm # once (48µs+12µs) by Archive::Zip::Member::BEGIN@26 at line 26 of Archive/Zip/Member.pm # once (43µs+16µs) by Compress::Raw::Zlib::BEGIN@107 at line 107 of Compress/Raw/Zlib.pm # once (46µs+9µs) by Archive::Zip::BEGIN@236 at line 236 of Archive/Zip.pm # once (44µs+10µs) by Archive::Zip::BEGIN@159 at line 159 of Archive/Zip.pm # once (43µs+11µs) by Compress::Raw::Zlib::BEGIN@72 at line 72 of Compress/Raw/Zlib.pm # once (44µs+10µs) by Archive::Zip::BEGIN@233 at line 233 of Archive/Zip.pm # once (43µs+11µs) by Archive::Zip::BEGIN@150 at line 150 of Archive/Zip.pm # once (44µs+9µs) by Archive::Zip::BEGIN@161 at line 161 of Archive/Zip.pm # once (44µs+9µs) by Compress::Raw::Zlib::BEGIN@103 at line 103 of Compress/Raw/Zlib.pm # once (44µs+9µs) by Archive::Zip::BEGIN@211 at line 211 of Archive/Zip.pm # once (42µs+11µs) by Archive::Zip::BEGIN@162 at line 162 of Archive/Zip.pm # once (44µs+9µs) by Archive::Zip::BEGIN@190 at line 190 of Archive/Zip.pm # once (43µs+10µs) by Archive::Zip::BEGIN@216 at line 216 of Archive/Zip.pm # once (42µs+10µs) by Compress::Raw::Zlib::BEGIN@86 at line 86 of Compress/Raw/Zlib.pm # once (42µs+10µs) by Archive::Zip::Member::BEGIN@27 at line 27 of Archive/Zip/Member.pm # once (42µs+10µs) by Archive::Zip::Member::BEGIN@29 at line 29 of Archive/Zip/Member.pm # once (41µs+11µs) by Archive::Zip::BEGIN@163 at line 163 of Archive/Zip.pm # once (42µs+10µs) by Archive::Zip::BEGIN@196 at line 196 of Archive/Zip.pm # once (42µs+10µs) by Archive::Zip::BEGIN@244 at line 244 of Archive/Zip.pm # once (42µs+10µs) by Compress::Raw::Zlib::BEGIN@112 at line 112 of Compress/Raw/Zlib.pm # once (42µs+10µs) by File::Temp::BEGIN@228 at line 228 of File/Temp.pm # once (42µs+10µs) by File::Temp::BEGIN@220 at line 220 of File/Temp.pm # once (42µs+10µs) by Archive::Zip::BEGIN@166 at line 166 of Archive/Zip.pm # once (43µs+9µs) by Archive::Zip::BEGIN@207 at line 207 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::Member::BEGIN@34 at line 34 of Archive/Zip/Member.pm # once (42µs+10µs) by Archive::Zip::BEGIN@170 at line 170 of Archive/Zip.pm # once (42µs+9µs) by Archive::Zip::BEGIN@208 at line 208 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@167 at line 167 of Archive/Zip.pm # once (40µs+11µs) by Compress::Raw::Zlib::BEGIN@84 at line 84 of Compress/Raw/Zlib.pm # once (42µs+9µs) by Compress::Raw::Zlib::BEGIN@113 at line 113 of Compress/Raw/Zlib.pm # once (41µs+10µs) by Archive::Zip::Member::BEGIN@32 at line 32 of Archive/Zip/Member.pm # once (41µs+10µs) by Archive::Zip::Member::BEGIN@28 at line 28 of Archive/Zip/Member.pm # once (41µs+10µs) by Archive::Zip::BEGIN@160 at line 160 of Archive/Zip.pm # once (42µs+10µs) by Time::Local::BEGIN@28 at line 28 of Time/Local.pm # once (41µs+10µs) by Archive::Zip::BEGIN@188 at line 188 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@181 at line 181 of Archive/Zip.pm # once (41µs+10µs) by File::Temp::BEGIN@229 at line 229 of File/Temp.pm # once (42µs+9µs) by Archive::Zip::BEGIN@240 at line 240 of Archive/Zip.pm # once (42µs+9µs) by Archive::Zip::BEGIN@221 at line 221 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@169 at line 169 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@164 at line 164 of Archive/Zip.pm # once (40µs+11µs) by Archive::Zip::BEGIN@151 at line 151 of Archive/Zip.pm # once (39µs+11µs) by Compress::Raw::Zlib::BEGIN@102 at line 102 of Compress/Raw/Zlib.pm # once (41µs+10µs) by Compress::Raw::Zlib::BEGIN@104 at line 104 of Compress/Raw/Zlib.pm # once (42µs+9µs) by Archive::Zip::BEGIN@232 at line 232 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@246 at line 246 of Archive/Zip.pm # once (42µs+9µs) by Archive::Zip::BEGIN@249 at line 249 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@235 at line 235 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::Member::BEGIN@35 at line 35 of Archive/Zip/Member.pm # once (41µs+9µs) by Archive::Zip::BEGIN@174 at line 174 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@229 at line 229 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@165 at line 165 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@183 at line 183 of Archive/Zip.pm # once (41µs+10µs) by Archive::Zip::BEGIN@168 at line 168 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@189 at line 189 of Archive/Zip.pm # once (42µs+9µs) by Archive::Zip::BEGIN@238 at line 238 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@251 at line 251 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@172 at line 172 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@152 at line 152 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@212 at line 212 of Archive/Zip.pm # once (40µs+10µs) by Compress::Raw::Zlib::BEGIN@105 at line 105 of Compress/Raw/Zlib.pm # once (40µs+10µs) by Archive::Zip::BEGIN@206 at line 206 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@250 at line 250 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@245 at line 245 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@176 at line 176 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@230 at line 230 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@228 at line 228 of Archive/Zip.pm # once (41µs+9µs) by Archive::Zip::BEGIN@199 at line 199 of Archive/Zip.pm # once (39µs+10µs) by Archive::Zip::BEGIN@153 at line 153 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@222 at line 222 of Archive/Zip.pm # once (40µs+9µs) by Archive::Zip::BEGIN@226 at line 226 of Archive/Zip.pm # once (40µs+10µs) by Archive::Zip::BEGIN@173 at line 173 of Archive/Zip.pm # once (40µs+10µs) by Compress::Raw::Zlib::BEGIN@111 at line 111 of Compress/Raw/Zlib.pm # once (40µs+9µs) by Archive::Zip::BEGIN@247 at line 247 of Archive/Zip.pm # once (40µs+9µs) by Compress::Raw::Zlib::BEGIN@88 at line 88 of Compress/Raw/Zlib.pm # once (40µs+9µs) by Compress::Raw::Zlib::BEGIN@85 at line 85 of Compress/Raw/Zlib.pm # once (39µs+10µs) by Archive::Zip::BEGIN@175 at line 175 of Archive/Zip.pm # once (39µs+10µs) by Compress::Raw::Zlib::BEGIN@116 at line 116 of Compress/Raw/Zlib.pm # once (37µs+12µs) by Archive::Zip::Member::BEGIN@33 at line 33 of Archive/Zip/Member.pm # once (39µs+10µs) by Archive::Zip::BEGIN@243 at line 243 of Archive/Zip.pm # once (39µs+10µs) by File::Temp::BEGIN@224 at line 224 of File/Temp.pm # once (40µs+9µs) by Archive::Zip::BEGIN@262 at line 262 of Archive/Zip.pm # once (40µs+9µs) by Archive::Zip::BEGIN@248 at line 248 of Archive/Zip.pm # once (40µs+9µs) by Archive::Zip::BEGIN@182 at line 182 of Archive/Zip.pm # once (40µs+9µs) by Archive::Zip::BEGIN@191 at line 191 of Archive/Zip.pm # once (40µs+9µs) by Compress::Raw::Zlib::BEGIN@109 at line 109 of Compress/Raw/Zlib.pm # once (39µs+9µs) by Archive::Zip::BEGIN@217 at line 217 of Archive/Zip.pm # once (39µs+10µs) by Compress::Raw::Zlib::BEGIN@115 at line 115 of Compress/Raw/Zlib.pm # once (39µs+9µs) by Compress::Raw::Zlib::BEGIN@114 at line 114 of Compress/Raw/Zlib.pm # once (38µs+10µs) by Archive::Zip::BEGIN@201 at line 201 of Archive/Zip.pm # once (39µs+10µs) by Archive::Zip::BEGIN@263 at line 263 of Archive/Zip.pm # once (38µs+10µs) by Archive::Zip::BEGIN@198 at line 198 of Archive/Zip.pm # once (38µs+10µs) by Archive::Zip::BEGIN@197 at line 197 of Archive/Zip.pm # once (39µs+9µs) by Archive::Zip::BEGIN@171 at line 171 of Archive/Zip.pm # once (38µs+10µs) by Compress::Raw::Zlib::BEGIN@87 at line 87 of Compress/Raw/Zlib.pm # once (38µs+10µs) by Archive::Zip::BEGIN@200 at line 200 of Archive/Zip.pm # once (39µs+9µs) by Archive::Zip::BEGIN@215 at line 215 of Archive/Zip.pm # once (38µs+9µs) by Compress::Raw::Zlib::BEGIN@106 at line 106 of Compress/Raw/Zlib.pm # once (38µs+10µs) by Time::Local::BEGIN@29 at line 29 of Time/Local.pm # once (38µs+9µs) by Archive::Zip::BEGIN@225 at line 225 of Archive/Zip.pm # once (37µs+10µs) by Archive::Zip::BEGIN@239 at line 239 of Archive/Zip.pm # once (37µs+10µs) by File::Temp::BEGIN@230 at line 230 of File/Temp.pm # once (36µs+10µs) by Archive::Zip::BEGIN@220 at line 220 of Archive/Zip.pm
sub import {
4311992.15ms my $class = shift;
44 return unless @_; # Ignore 'use constant;'
45 my $constants;
46 my $multiple = ref $_[0];
47 my $pkg = caller;
48 my $flush_mro;
49 my $symtab;
50
51109213µs if (_CAN_PCS) {
522530µs245µs
# spent 29µs (12+17) within constant::BEGIN@52 which was called: # once (12µs+17µs) by Compress::Raw::Zlib::BEGIN@71 at line 52
no strict 'refs';
# spent 29µs making 1 call to constant::BEGIN@52 # spent 17µs making 1 call to strict::unimport
53 $symtab = \%{$pkg . '::'};
54 };
55
56218279µs if ( $multiple ) {
57 if (ref $_[0] ne 'HASH') {
58 require Carp;
59 Carp::croak("Invalid reference type '".ref(shift)."' not 'HASH'");
60 }
61 $constants = shift;
62 } else {
63 unless (defined $_[0]) {
64 require Carp;
65 Carp::croak("Can't use undef as constant name");
66 }
67 $constants->{+shift} = undef;
68 }
69
70 foreach my $name ( keys %$constants ) {
71 # Normal constant name
722181.55ms218561µs if ($name =~ $normal_constant_name and !$forbidden{$name}) {
# spent 293µs making 109 calls to constant::CORE:match, avg 3µs/call # spent 268µs making 109 calls to constant::CORE:regcomp, avg 2µs/call
73 # Everything is okay
74
75 # Name forced into main, but we're not in main. Fatal.
76 } elsif ($forced_into_main{$name} and $pkg ne 'main') {
77 require Carp;
78 Carp::croak("Constant name '$name' is forced into main::");
79
80 # Starts with double underscore. Fatal.
81 } elsif ($name =~ /^__/) {
82 require Carp;
83 Carp::croak("Constant name '$name' begins with '__'");
84
85 # Maybe the name is tolerable
86 } elsif ($name =~ $tolerable) {
87 # Then we'll warn only if you've asked for warnings
88 if (warnings::enabled()) {
89 if ($keywords{$name}) {
90 warnings::warn("Constant name '$name' is a Perl keyword");
91 } elsif ($forced_into_main{$name}) {
92 warnings::warn("Constant name '$name' is " .
93 "forced into package main::");
94 }
95 }
96
97 # Looks like a boolean
98 # use constant FRED == fred;
99 } elsif ($name =~ $boolean) {
100 require Carp;
101 if (@_) {
102 Carp::croak("Constant name '$name' is invalid");
103 } else {
104 Carp::croak("Constant name looks like boolean value");
105 }
106
107 } else {
108 # Must have bad characters
109 require Carp;
110 Carp::croak("Constant name '$name' has invalid characters");
111 }
112
113 {
1142464µs248µs
# spent 30µs (13+17) within constant::BEGIN@114 which was called: # once (13µs+17µs) by Compress::Raw::Zlib::BEGIN@71 at line 114
no strict 'refs';
# spent 30µs making 1 call to constant::BEGIN@114 # spent 17µs making 1 call to strict::unimport
115327441µs my $full_name = "${pkg}::$name";
116 $declared{$full_name}++;
117327761µs if ($multiple || @_ == 1) {
118 my $scalar = $multiple ? $constants->{$name} : $_[0];
119
120 # Work around perl bug #xxxxx: Sub names (actually glob
121 # names in general) ignore the UTF8 flag. So we have to
122 # turn it off to get the "right" symbol table entry.
123109167µs utf8::is_utf8 $name and utf8::encode $name;
# spent 167µs making 109 calls to utf8::is_utf8, avg 2µs/call
124
125 # The constant serves to optimise this entire block out on
126 # 5.8 and earlier.
127327688µs if (_CAN_PCS && $symtab && !exists $symtab->{$name}) {
128 # No typeglob yet, so we can use a reference as space-
129 # efficient proxy for a constant subroutine
130 # The check in Perl_ck_rvconst knows that inlinable
131 # constants from cv_const_sv are read only. So we have to:
132109152µs Internals::SvREADONLY($scalar, 1);
# spent 152µs making 109 calls to Internals::SvREADONLY, avg 1µs/call
133 $symtab->{$name} = \$scalar;
134 ++$flush_mro;
135 } else {
136 *$full_name = sub () { $scalar };
137 }
138 } elsif (@_) {
139 my @list = @_;
140 *$full_name = sub () { @list };
141 } else {
142 *$full_name = sub () { };
143 }
144 }
145 }
146 # Flush the cache exactly once if we make any direct symbol table changes.
147109260µs mro::method_changed_in($pkg) if _CAN_PCS && $flush_mro;
# spent 260µs making 109 calls to mro::method_changed_in, avg 2µs/call
148}
149
150153µs1;
151
152__END__
 
# spent 293µs within constant::CORE:match which was called 109 times, avg 3µs/call: # 109 times (293µs+0s) by constant::import at line 72, avg 3µs/call
sub constant::CORE:match; # opcode
# spent 18µs within constant::CORE:qr which was called 3 times, avg 6µs/call: # once (12µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 21 # once (3µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 22 # once (3µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 23
sub constant::CORE:qr; # opcode
# spent 313µs within constant::CORE:regcomp which was called 112 times, avg 3µs/call: # 109 times (268µs+0s) by constant::import at line 72, avg 2µs/call # once (24µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 21 # once (11µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 22 # once (10µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 23
sub constant::CORE:regcomp; # opcode