Profile of Time/HiRes.pm

← Index
NYTProf Performance Profile «line view»
For t/bug-md-11.t
Run on Fri Mar 8 13:27:24 2024
Reported on Fri Mar 8 13:30:23 2024

Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/5.38.2/x86_64-linux/Time/HiRes.pm
Statements | Executed 40 statements in 590µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
3 | 3 | 3 | 24µs | 1.40ms | Time::HiRes::::importTime::HiRes::import
1 | 1 | 1 | 12µs | 17µs | Time::HiRes::::AUTOLOADTime::HiRes::AUTOLOAD
1 | 1 | 1 | 12µs | 12µs | Time::HiRes::::BEGIN@3Time::HiRes::BEGIN@3
1 | 1 | 1 | 6µs | 11µs | Time::HiRes::::BEGIN@70Time::HiRes::BEGIN@70
1 | 1 | 1 | 4µs | 6µs | Time::HiRes::::BEGIN@4Time::HiRes::BEGIN@4
1 | 1 | 1 | 2µs | 2µs | Time::HiRes::::constantTime::HiRes::constant (xsub)
1 | 1 | 1 | 2µs | 2µs | Time::HiRes::::BEGIN@7Time::HiRes::BEGIN@7
1 | 1 | 1 | 800ns | 800ns | Time::HiRes::::__ANON__[:71]Time::HiRes::__ANON__[:71]
0 | 0 | 0 | 0s | 0s | Time::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Time::HiRes;
2 |  |  |  |  |
3 | 2 | 32µs | 1 | 12µs | # spent 12µs within Time::HiRes::BEGIN@3 which was called: # once (12µs+0s) by Test2::API::BEGIN@5 at line 3 { use 5.006; } # spent 12µs making 1 call to Time::HiRes::BEGIN@3
4 | 3 | 24µs | 2 | 7µs | # spent 6µs (4+2) within Time::HiRes::BEGIN@4 which was called: # once (4µs+2µs) by Test2::API::BEGIN@5 at line 4 use strict; # spent 6µs making 1 call to Time::HiRes::BEGIN@4 # spent 2µs making 1 call to strict::import
5 |  |  |  |  |
6 | 1 | 400ns |  |  | require Exporter;
7 | 2 | 139µs | 1 | 2µs | # spent 2µs within Time::HiRes::BEGIN@7 which was called: # once (2µs+0s) by Test2::API::BEGIN@5 at line 7 use XSLoader (); # spent 2µs making 1 call to Time::HiRes::BEGIN@7
8 |  |  |  |  |
9 | 1 | 6µs |  |  | our @ISA = qw(Exporter);
10 |  |  |  |  |
11 | 1 | 200ns |  |  | our @EXPORT = qw( );
12 |  |  |  |  | # More or less this same list is in Makefile.PL. Should unify.
13 | 1 | 3µs |  |  | our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
14 |  |  |  |  | getitimer setitimer nanosleep clock_gettime clock_getres
15 |  |  |  |  | clock clock_nanosleep
16 |  |  |  |  | CLOCKS_PER_SEC
17 |  |  |  |  | CLOCK_BOOTTIME
18 |  |  |  |  | CLOCK_HIGHRES
19 |  |  |  |  | CLOCK_MONOTONIC
20 |  |  |  |  | CLOCK_MONOTONIC_COARSE
21 |  |  |  |  | CLOCK_MONOTONIC_FAST
22 |  |  |  |  | CLOCK_MONOTONIC_PRECISE
23 |  |  |  |  | CLOCK_MONOTONIC_RAW
24 |  |  |  |  | CLOCK_PROCESS_CPUTIME_ID
25 |  |  |  |  | CLOCK_PROF
26 |  |  |  |  | CLOCK_REALTIME
27 |  |  |  |  | CLOCK_REALTIME_COARSE
28 |  |  |  |  | CLOCK_REALTIME_FAST
29 |  |  |  |  | CLOCK_REALTIME_PRECISE
30 |  |  |  |  | CLOCK_REALTIME_RAW
31 |  |  |  |  | CLOCK_SECOND
32 |  |  |  |  | CLOCK_SOFTTIME
33 |  |  |  |  | CLOCK_THREAD_CPUTIME_ID
34 |  |  |  |  | CLOCK_TIMEOFDAY
35 |  |  |  |  | CLOCK_UPTIME
36 |  |  |  |  | CLOCK_UPTIME_COARSE
37 |  |  |  |  | CLOCK_UPTIME_FAST
38 |  |  |  |  | CLOCK_UPTIME_PRECISE
39 |  |  |  |  | CLOCK_UPTIME_RAW
40 |  |  |  |  | CLOCK_VIRTUAL
41 |  |  |  |  | ITIMER_PROF
42 |  |  |  |  | ITIMER_REAL
43 |  |  |  |  | ITIMER_REALPROF
44 |  |  |  |  | ITIMER_VIRTUAL
45 |  |  |  |  | TIMER_ABSTIME
46 |  |  |  |  | d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
47 |  |  |  |  | d_nanosleep d_clock_gettime d_clock_getres
48 |  |  |  |  | d_clock d_clock_nanosleep d_hires_stat
49 |  |  |  |  | d_futimens d_utimensat d_hires_utime
50 |  |  |  |  | stat lstat utime
51 |  |  |  |  | );
52 |  |  |  |  |
53 | 1 | 200ns |  |  | our $VERSION = '1.9775';
54 | 1 | 100ns |  |  | our $XS_VERSION = $VERSION;
55 | 1 | 10µs |  |  | $VERSION = eval $VERSION; # spent 2µs executing statements in string eval
56 |  |  |  |  |
57 |  |  |  |  | our $AUTOLOAD;
58 |  |  |  |  | # spent 17µs (12+5) within Time::HiRes::AUTOLOAD which was called: # once (12µs+5µs) by Time::HiRes::import at line 79 sub AUTOLOAD {
59 | 1 | 200ns |  |  | my $constname;
60 | 1 | 6µs | 1 | 3µs | ($constname = $AUTOLOAD) =~ s/.*:://; # spent 3µs making 1 call to CORE::subst
61 |  |  |  |  | # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n";
62 | 1 | 600ns |  |  | die "&Time::HiRes::constant not defined" if $constname eq 'constant';
63 | 1 | 5µs | 1 | 2µs | my ($error, $val) = constant($constname); # spent 2µs making 1 call to Time::HiRes::constant
64 |  |  |  |  | # print "AUTOLOAD: error = $error, val = $val\n";
65 | 1 | 300ns |  |  | if ($error) {
66 |  |  |  |  | my (undef,$file,$line) = caller;
67 |  |  |  |  | die "$error at $file line $line.\n";
68 |  |  |  |  | }
69 |  |  |  |  | {
70 | 3 | 200µs | 2 | 15µs | # spent 11µs (6+5) within Time::HiRes::BEGIN@70 which was called: # once (6µs+5µs) by Test2::API::BEGIN@5 at line 70 no strict 'refs'; # spent 11µs making 1 call to Time::HiRes::BEGIN@70 # spent 5µs making 1 call to strict::unimport
71 | 2 | 4µs |  |  | # spent 800ns within Time::HiRes::__ANON__[/home/micha/.plenv/versions/5.38.2/lib/perl5/5.38.2/x86_64-linux/Time/HiRes.pm:71] which was called: # once (800ns+0s) by Time::HiRes::import at line 73 *$AUTOLOAD = sub { $val };
72 |  |  |  |  | }
73 | 1 | 3µs | 1 | 800ns | goto &$AUTOLOAD; # spent 800ns making 1 call to Time::HiRes::__ANON__[Time/HiRes.pm:71]
74 |  |  |  |  | }
75 |  |  |  |  |
76 |  |  |  |  | # spent 1.40ms (24µs+1.38) within Time::HiRes::import which was called 3 times, avg 466µs/call: # once (8µs+1.27ms) by Test2::API::BEGIN@5 at line 5 of Test2/API.pm # once (11µs+64µs) by File::Copy::BEGIN@1 at line 1 of (eval 12)[File/Copy.pm:19] # once (5µs+36µs) by Test2::EventFacet::Trace::BEGIN@10 at line 10 of Test2/EventFacet/Trace.pm sub import {
77 | 3 | 900ns |  |  | my $this = shift;
78 | 3 | 2µs |  |  | for my $i (@_) {
79 | 4 | 7µs | 1 | 17µs | if (($i eq 'clock_getres' && !&d_clock_getres) || # spent 17µs making 1 call to Time::HiRes::AUTOLOAD
80 |  |  |  |  | ($i eq 'clock_gettime' && !&d_clock_gettime) ||
81 |  |  |  |  | ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) ||
82 |  |  |  |  | ($i eq 'clock' && !&d_clock) ||
83 |  |  |  |  | ($i eq 'nanosleep' && !&d_nanosleep) ||
84 |  |  |  |  | ($i eq 'usleep' && !&d_usleep) ||
85 |  |  |  |  | ($i eq 'utime' && !&d_hires_utime) ||
86 |  |  |  |  | ($i eq 'ualarm' && !&d_ualarm)) {
87 |  |  |  |  | require Carp;
88 |  |  |  |  | Carp::croak("Time::HiRes::$i(): unimplemented in this platform");
89 |  |  |  |  | }
90 |  |  |  |  | }
91 | 3 | 9µs | 3 | 1.20ms | Time::HiRes->export_to_level(1, $this, @_); # spent 1.20ms making 3 calls to Exporter::export_to_level, avg 399µs/call
92 |  |  |  |  | }
93 |  |  |  |  |
94 | 1 | 131µs | 1 | 126µs | XSLoader::load( 'Time::HiRes', $XS_VERSION ); # spent 126µs making 1 call to XSLoader::load
95 |  |  |  |  |
96 |  |  |  |  | # Preloaded methods go here.
97 |  |  |  |  |
98 |  |  |  |  | sub tv_interval {
99 |  |  |  |  | # probably could have been done in C
100 |  |  |  |  | my ($a, $b) = @_;
101 |  |  |  |  | $b = [gettimeofday()] unless defined($b);
102 |  |  |  |  | (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000);
103 |  |  |  |  | }
104 |  |  |  |  |
105 |  |  |  |  | # Autoload methods go after =cut, and are processed by the autosplit program.
106 |  |  |  |  |
107 | 1 | 7µs |  |  | 1;
108 |  |  |  |  | __END__
|  |  |  |  | # spent 2µs within Time::HiRes::constant which was called: # once (2µs+0s) by Time::HiRes::AUTOLOAD at line 63 sub Time::HiRes::constant; # xsub