← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:19 2014

Filename/usr/share/perl/5.14/XSLoader.pm
StatementsExecuted 2 statements in 119µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2525256.15ms6.88msXSLoader::::loadXSLoader::load (recurses: max depth 1, inclusive time 130µ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.13";
6
7#use strict;
8
9# enable debug/trace messages from DynaLoader perl code
10# $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
11
12package DynaLoader;
13
14# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
15# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
16boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
17 !defined(&dl_error);
18package XSLoader;
19
20
# spent 6.88ms (6.15+729µs) within XSLoader::load which was called 25 times, avg 275µs/call: # once (230µs+846µs) by JSON::BEGIN@2 at line 1473 of JSON/XS.pm # once (880µs+0s) by DateTime::BEGIN@49 at line 36 of POSIX.pm # once (503µs+0s) by B::BEGIN@17 at line 27 of B.pm # once (400µs+0s) by POSIX::BEGIN@13 at line 11 of Fcntl.pm # once (362µs+0s) by Value::Convertor::BEGIN@53 at line 24 of List/Util.pm # once (306µs+0s) by Value::Convertor::BEGIN@61 at line 21 of DateTime.pm # once (292µs+0s) by File::Basename::BEGIN@42 at line 85 of re.pm # once (284µs+0s) by Value::Convertor::BEGIN@55 at line 36 of Data/Dumper.pm # once (278µs+0s) by Module::Runtime::require_module at line 42 of Params/Validate/XS.pm # once (261µs+0s) by Mail::Sendmail::BEGIN@54 at line 834 of Socket.pm # once (255µs+0s) by Module::Runtime::require_module at line 15 of Class/Load/XS.pm # once (253µs+0s) by DateTime::TimeZone::Local::Unix::BEGIN@12 at line 80 of Cwd.pm # once (208µs+0s) by Mentat::Storage::Mongo::BEGIN@162 at line 35 of MongoDB.pm # once (194µs+12µs) by MongoDB::MongoClient::BEGIN@34 at line 10 of Encode.pm # once (173µs+0s) by IO::Handle::BEGIN@9 at line 11 of IO.pm # once (165µs+0s) by Log::Writer::Syslog::BEGIN@70 at line 65 of Sys/Syslog.pm # once (146µs+0s) by Log::Writer::Email::BEGIN@71 at line 72 of Storable.pm # once (146µs+0s) by Module::Runtime::require_module at line 21 of Package/Stash/XS.pm # once (143µs+0s) by MongoDB::MongoClient::BEGIN@29 at line 24 of Digest/MD5.pm # once (138µs+0s) by Readonly::BEGIN@2 at line 25 of Readonly/XS.pm # once (130µs+0s) by MIME::QuotedPrint::BEGIN@12 at line 14 of MIME/Base64.pm # once (121µs+0s) by Sys::Hostname::BEGIN@16 at line 22 of Sys/Hostname.pm # once (118µs+0s) by MRO::Compat::BEGIN@10 at line 41 of mro.pm # once (36µs+0s) by Moose::Exporter::BEGIN@13 at line 41 of Class/MOP.pm # once (130µs+-130µs) by DynaLoader::BEGIN@95 at line 101 of attributes.pm
sub load {
21 package DynaLoader;
22
23 my ($module, $modlibname) = caller();
24
25 if (@_) {
26 $module = $_[0];
27 } else {
28 $_[0] = $module;
29 }
30
31 # work with static linking too
32 my $boots = "$module\::bootstrap";
33 goto &$boots if defined &$boots;
34
35 goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file;
36
37 my @modparts = split(/::/,$module);
38 my $modfname = $modparts[-1];
39
40 my $modpname = join('/',@modparts);
41 my $c = @modparts;
42 $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename
43 my $file = "$modlibname/auto/$modpname/$modfname.so";
44
45# print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
46
47 my $bs = $file;
48 $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
49
50 if (-s $bs) { # only read file if it's not empty
51# print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
52 eval { do $bs; };
53 warn "$bs: $@\n" if $@;
54 }
55
56 goto \&XSLoader::bootstrap_inherit if not -f $file or -s $bs;
57
58 my $bootname = "boot_$module";
59 $bootname =~ s/\W/_/g;
60 @DynaLoader::dl_require_symbols = ($bootname);
61
62 my $boot_symbol_ref;
63
64 # Many dynamic extension loading problems will appear to come from
65 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
66 # Often these errors are actually occurring in the initialisation
67 # C code of the extension XS file. Perl reports the error as being
68 # in this perl code simply because this was the last perl code
69 # it executed.
70
71 my $libref = dl_load_file($file, 0) or do {
72 require Carp;
73 Carp::croak("Can't load '$file' for module $module: " . dl_error());
74 };
75 push(@DynaLoader::dl_librefs,$libref); # record loaded object
76
77 my @unresolved = dl_undef_symbols();
78 if (@unresolved) {
79 require Carp;
80 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
81 }
82
83 $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
84 require Carp;
85 Carp::croak("Can't find '$bootname' symbol in $file\n");
86 };
87
88 push(@DynaLoader::dl_modules, $module); # record loaded module
89
90 boot:
91 my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file);
92
93 # See comment block above
94 push(@DynaLoader::dl_shared_objects, $file); # record files loaded
952119µs543µs return &$xs(@_);
# spent 31µs making 1 call to attributes::import # spent 12µs making 4 calls to Encode::define_encoding, avg 3µs/call
96}
97
98sub bootstrap_inherit {
99 require DynaLoader;
100 goto \&DynaLoader::bootstrap_inherit;
101}
102
1031;
104
105__END__
106