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

Filename/usr/share/perl/5.20/XSLoader.pm
StatementsExecuted 2 statements in 736µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
28282817.5ms18.9msXSLoader::::loadXSLoader::load (recurses: max depth 1, inclusive time 144µs)
0000s0sXSLoader::::bootstrap_inheritXSLoader::bootstrap_inherit
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Generated from XSLoader.pm.PL (resolved %Config::Config value)
2
3package XSLoader;
4
5$VERSION = "0.17";
6
7#use strict;
8
9package DynaLoader;
10
11# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
12# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
13boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
14 !defined(&dl_error);
15package XSLoader;
16
17
# spent 18.9ms (17.5+1.41) within XSLoader::load which was called 28 times, avg 677µs/call: # once (8.91ms+1.54ms) by JSON::BEGIN@2 at line 1492 of JSON/XS.pm # once (3.63ms+0s) by C4::Context::BEGIN@4 at line 10 of Net/Z3950/ZOOM.pm # once (402µs+0s) by C4::Context::BEGIN@105 at line 36 of POSIX.pm # once (383µs+0s) by MARC::Charset::Table::BEGIN@42 at line 74 of GDBM_File.pm # once (302µs+0s) by Mail::Sendmail::BEGIN@54 at line 181 of Socket.pm # once (294µs+0s) by Module::Runtime::require_module at line 21 of Package/Stash/XS.pm # once (291µs+0s) by IO::Seekable::BEGIN@12 at line 11 of Fcntl.pm # once (246µs+0s) by IO::Handle::BEGIN@9 at line 11 of IO.pm # once (231µs+0s) by Modern::Perl::BEGIN@12 at line 41 of mro.pm # once (223µs+0s) by C4::Context::BEGIN@100 at line 22 of List/Util.pm # once (175µs+16µs) by Date::Manip::Base::BEGIN@24 at line 10 of Encode.pm # once (190µs+0s) by YAML::Syck::BEGIN@16 at line 28 of YAML/Syck.pm # once (185µs+0s) by C4::Auth::BEGIN@22 at line 24 of Digest/MD5.pm # once (180µs+0s) by Date::Manip::Date::BEGIN@428 at line 7 of Tie/Hash/NamedCapture.pm # once (174µs+0s) by DateTime::try {...} at line 30 of DateTime.pm # once (174µs+0s) by Date::Manip::Obj::BEGIN@13 at line 74 of Storable.pm # once (169µs+0s) by C4::Letters::BEGIN@23 at line 14 of MIME/Base64.pm # once (162µs+0s) by MARC::Field::BEGIN@456 at line 6 of arybase.pm # once (162µs+0s) by Data::Dumper::BEGIN@24 at line 34 of Data/Dumper.pm # once (161µs+0s) by Variable::Magic::BEGIN@213 at line 215 of Variable/Magic.pm # once (154µs+0s) by _charnames::BEGIN@14 at line 85 of re.pm # once (142µs+0s) by Try::Tiny::BEGIN@1 at line 67 of Sub/Name.pm # once (138µs+0s) by Module::Runtime::require_module at line 40 of Params/Validate/XS.pm # once (120µs+0s) by Module::Runtime::require_module at line 17 of Class/Load/XS.pm # once (118µs+0s) by Sys::Hostname::BEGIN@16 at line 22 of Sys/Hostname.pm # once (51µs+0s) by parent::import at line 77 of Crypt/Eksblowfish/Subkeyed.pm # once (37µs+0s) by DateTime::TimeZone::Local::BEGIN@8 at line 14 of File/Spec/Unix.pm # once (144µs+-144µs) by DynaLoader::BEGIN@92 at line 110 of attributes.pm
sub load {
18 package DynaLoader;
19
20 my ($module, $modlibname) = caller();
21
22 if (@_) {
23 $module = $_[0];
24 } else {
25 $_[0] = $module;
26 }
27
28 # work with static linking too
29 my $boots = "$module\::bootstrap";
30 goto &$boots if defined &$boots;
31
32 goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file;
33
34 my @modparts = split(/::/,$module);
35 my $modfname = $modparts[-1];
36
37 my $modpname = join('/',@modparts);
38 my $c = @modparts;
39 $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename
40 my $file = "$modlibname/auto/$modpname/$modfname.so";
41
42# print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
43
44 my $bs = $file;
45 $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
46
47 if (-s $bs) { # only read file if it's not empty
48# print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
49 eval { do $bs; };
50 warn "$bs: $@\n" if $@;
51 }
52
53 goto \&XSLoader::bootstrap_inherit if not -f $file or -s $bs;
54
55 my $bootname = "boot_$module";
56 $bootname =~ s/\W/_/g;
57 @DynaLoader::dl_require_symbols = ($bootname);
58
59 my $boot_symbol_ref;
60
61 # Many dynamic extension loading problems will appear to come from
62 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
63 # Often these errors are actually occurring in the initialisation
64 # C code of the extension XS file. Perl reports the error as being
65 # in this perl code simply because this was the last perl code
66 # it executed.
67
68 my $libref = dl_load_file($file, 0) or do {
69 require Carp;
70 Carp::croak("Can't load '$file' for module $module: " . dl_error());
71 };
72 push(@DynaLoader::dl_librefs,$libref); # record loaded object
73
74 my @unresolved = dl_undef_symbols();
75 if (@unresolved) {
76 require Carp;
77 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
78 }
79
80 $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
81 require Carp;
82 Carp::croak("Can't find '$bootname' symbol in $file\n");
83 };
84
85 push(@DynaLoader::dl_modules, $module); # record loaded module
86
87 boot:
88 my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file);
89
90 # See comment block above
91 push(@DynaLoader::dl_shared_objects, $file); # record files loaded
922736µs547µs return &$xs(@_);
# spent 31µs making 1 call to attributes::import # spent 16µs making 4 calls to Encode::define_encoding, avg 4µs/call
93}
94
95sub bootstrap_inherit {
96 require DynaLoader;
97 goto \&DynaLoader::bootstrap_inherit;
98}
99
1001;
101
102__END__
103