← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 10:04:38 2014
Reported on Tue Jun 24 10:05:08 2014

Filename/usr/lib/perl/5.14/Time/HiRes.pm
StatementsExecuted 24 statements in 1.37ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111419µs796µsTime::HiRes::::BEGIN@4Time::HiRes::BEGIN@4
11140µs40µsTime::HiRes::::bootstrapTime::HiRes::bootstrap (xsub)
22226µs1.71msTime::HiRes::::importTime::HiRes::import
11113µs16µsTime::HiRes::::BEGIN@3Time::HiRes::BEGIN@3
2218µs8µsTime::HiRes::::timeTime::HiRes::time (xsub)
1118µs33µsTime::HiRes::::BEGIN@42Time::HiRes::BEGIN@42
0000s0sTime::HiRes::::AUTOLOADTime::HiRes::AUTOLOAD
0000s0sTime::HiRes::::__ANON__[:43]Time::HiRes::__ANON__[:43]
0000s0sTime::HiRes::::tv_intervalTime::HiRes::tv_interval
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Time::HiRes;
2
3227µs219µs
# spent 16µs (13+3) within Time::HiRes::BEGIN@3 which was called: # once (13µs+3µs) by main::BEGIN@6 at line 3
use strict;
# spent 16µs making 1 call to Time::HiRes::BEGIN@3 # spent 3µs making 1 call to strict::import
42236µs2872µs
# spent 796µs (419+377) within Time::HiRes::BEGIN@4 which was called: # once (419µs+377µs) by main::BEGIN@6 at line 4
use vars qw($VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
# spent 796µs making 1 call to Time::HiRes::BEGIN@4 # spent 77µs making 1 call to vars::import
5
61597µsrequire Exporter;
71113µsrequire DynaLoader;
8
917µs@ISA = qw(Exporter DynaLoader);
10
111200ns@EXPORT = qw( );
1215µs@EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
13 getitimer setitimer nanosleep clock_gettime clock_getres
14 clock clock_nanosleep
15 CLOCK_HIGHRES CLOCK_MONOTONIC CLOCK_PROCESS_CPUTIME_ID
16 CLOCK_REALTIME CLOCK_SOFTTIME CLOCK_THREAD_CPUTIME_ID
17 CLOCK_TIMEOFDAY CLOCKS_PER_SEC
18 ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF
19 TIMER_ABSTIME
20 d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
21 d_nanosleep d_clock_gettime d_clock_getres
22 d_clock d_clock_nanosleep
23 stat
24 );
25
261200ns$VERSION = '1.9721_01';
271300ns$XS_VERSION = $VERSION;
28129µs$VERSION = eval $VERSION;
# spent 2µs executing statements in string eval
29
30sub AUTOLOAD {
31 my $constname;
32 ($constname = $AUTOLOAD) =~ s/.*:://;
33 # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n";
34 die "&Time::HiRes::constant not defined" if $constname eq 'constant';
35 my ($error, $val) = constant($constname);
36 # print "AUTOLOAD: error = $error, val = $val\n";
37 if ($error) {
38 my (undef,$file,$line) = caller;
39 die "$error at $file line $line.\n";
40 }
41 {
422322µs259µs
# spent 33µs (8+25) within Time::HiRes::BEGIN@42 which was called: # once (8µs+25µs) by main::BEGIN@6 at line 42
no strict 'refs';
# spent 33µs making 1 call to Time::HiRes::BEGIN@42 # spent 25µs making 1 call to strict::unimport
43 *$AUTOLOAD = sub { $val };
44 }
45 goto &$AUTOLOAD;
46}
47
48
# spent 1.71ms (26µs+1.69) within Time::HiRes::import which was called 2 times, avg 857µs/call: # once (12µs+1.62ms) by main::BEGIN@6 at line 6 of mentat.storage.mongo.pl # once (15µs+68µs) by Mentat::Storage::Mongo::BEGIN@153 at line 153 of Mentat/Storage/Mongo.pm
sub import {
49614µs my $this = shift;
50 for my $i (@_) {
5127µs if (($i eq 'clock_getres' && !&d_clock_getres) ||
52 ($i eq 'clock_gettime' && !&d_clock_gettime) ||
53 ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) ||
54 ($i eq 'clock' && !&d_clock) ||
55 ($i eq 'nanosleep' && !&d_nanosleep) ||
56 ($i eq 'usleep' && !&d_usleep) ||
57 ($i eq 'ualarm' && !&d_ualarm)) {
58 require Carp;
59 Carp::croak("Time::HiRes::$i(): unimplemented in this platform");
60 }
61 }
6221.49ms Time::HiRes->export_to_level(1, $this, @_);
# spent 1.49ms making 2 calls to Exporter::export_to_level, avg 743µs/call
63}
64
6517µs1225µsbootstrap Time::HiRes;
# spent 225µs making 1 call to DynaLoader::bootstrap
66
67# Preloaded methods go here.
68
69sub tv_interval {
70 # probably could have been done in C
71 my ($a, $b) = @_;
72 $b = [gettimeofday()] unless defined($b);
73 (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000);
74}
75
76# Autoload methods go after =cut, and are processed by the autosplit program.
77
7819µs1;
79__END__
 
# spent 40µs within Time::HiRes::bootstrap which was called: # once (40µs+0s) by DynaLoader::bootstrap at line 207 of DynaLoader.pm
sub Time::HiRes::bootstrap; # xsub
# spent 8µs within Time::HiRes::time which was called 2 times, avg 4µs/call: # once (6µs+0s) by main::RUNTIME at line 27 of mentat.storage.mongo.pl # once (3µs+0s) by main::RUNTIME at line 45 of mentat.storage.mongo.pl
sub Time::HiRes::time; # xsub