line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1389
|
use strict;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
72
|
|
2
|
1
|
|
|
1
|
|
12
|
use Benchmark::Harness;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
62
|
|
3
|
|
|
|
|
|
|
package Benchmark::Harness::ValuesHighRes;
|
4
|
1
|
|
|
1
|
|
10
|
use base qw(Benchmark::Harness::Values);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1356
|
|
5
|
1
|
|
|
1
|
|
13
|
use Benchmark::Harness::Constants;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
145
|
|
6
|
1
|
|
|
1
|
|
9
|
use vars qw($VERSION); $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
145
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Benchmark::Harness::Handler::ValuesHighRes;
|
9
|
1
|
|
|
1
|
|
10
|
use base qw(Benchmark::Harness::Handler::Values);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1012
|
|
10
|
1
|
|
|
1
|
|
13
|
use Benchmark::Harness::Constants;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
144
|
|
11
|
1
|
|
|
1
|
|
9
|
use Time::HiRes;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
12
|
|
|
|
|
|
|
=pod
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 Benchmark::Harness::ValuesHighRes
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 SYNOPSIS
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
High resolution timing combined with Benchmark::Harness::Values.
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head2 Impact
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This produces a slightly larger XML report than the Values harness, since HighRes times consume more digits than low-res ones.
|
24
|
|
|
|
|
|
|
This report will be about 20% larger than that of Trace.
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=over 8
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item1 MSWin32
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Approximately 0.8 millisecond per trace (mostly from *::Trace.pm).
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item1 Linux
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=back
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
### ###########################################################################
|
39
|
|
|
|
|
|
|
sub reportTraceInfo {
|
40
|
0
|
|
|
0
|
|
|
my $self = shift;
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# return Benchmark::Harness::Handler::Values::reportTraceInfo($self,
|
43
|
0
|
|
|
|
|
|
return Benchmark::Harness::Handler::reportTraceInfo($self,
|
44
|
|
|
|
|
|
|
{
|
45
|
|
|
|
|
|
|
't' => ( Time::HiRes::time() - $self->[HNDLR_HARNESS]->{_startTime} )
|
46
|
|
|
|
|
|
|
}
|
47
|
|
|
|
|
|
|
,@_
|
48
|
|
|
|
|
|
|
);
|
49
|
|
|
|
|
|
|
}
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
### ###########################################################################
|
52
|
|
|
|
|
|
|
#sub reportValueInfo {
|
53
|
|
|
|
|
|
|
# my $self = shift;
|
54
|
|
|
|
|
|
|
# return Benchmark::Harness::Handler::Values::reportValueInfo($self,
|
55
|
|
|
|
|
|
|
# ,@_
|
56
|
|
|
|
|
|
|
# );
|
57
|
|
|
|
|
|
|
#}
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
### ###########################################################################
|
60
|
|
|
|
|
|
|
# USAGE: Benchmark::HarnessVlauesHighRes::OnSubEntry('class::method',
|
61
|
|
|
|
|
|
|
sub OnSubEntry {
|
62
|
0
|
|
|
0
|
|
|
my $self = shift;
|
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $i=1;
|
65
|
0
|
|
|
|
|
|
for ( @_ ) {
|
66
|
0
|
|
|
|
|
|
$self->NamedObjects($i, $_);
|
67
|
0
|
0
|
|
|
|
|
last if ( $i++ == 20 );
|
68
|
|
|
|
|
|
|
}
|
69
|
0
|
0
|
|
|
|
|
if ( scalar(@_) > 20 ) {
|
70
|
|
|
|
|
|
|
##$self->print("");
|
71
|
|
|
|
|
|
|
};
|
72
|
0
|
|
|
|
|
|
$self->reportTraceInfo();#(shift, caller(1));
|
73
|
0
|
|
|
|
|
|
return @_; # return the input arguments unchanged.
|
74
|
|
|
|
|
|
|
}
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
### ###########################################################################
|
77
|
|
|
|
|
|
|
# USAGE: Benchmark::Trace::MethodReturn('class::method', [, 'class::method' ] )
|
78
|
|
|
|
|
|
|
sub OnSubExit {
|
79
|
0
|
|
|
0
|
|
|
my $self = shift;
|
80
|
|
|
|
|
|
|
|
81
|
0
|
0
|
|
|
|
|
if (wantarray) {
|
82
|
0
|
|
|
|
|
|
my $i=1;
|
83
|
0
|
|
|
|
|
|
for ( @_ ) {
|
84
|
0
|
0
|
|
|
|
|
$self->NamedObjects($i, $_) if defined $_;
|
85
|
0
|
0
|
|
|
|
|
last if ( $i++ == 20 );
|
86
|
|
|
|
|
|
|
}
|
87
|
0
|
0
|
|
|
|
|
if ( scalar(@_) > 20 ) {
|
88
|
|
|
|
|
|
|
##$self->print("");
|
89
|
|
|
|
|
|
|
};
|
90
|
|
|
|
|
|
|
} else {
|
91
|
0
|
0
|
|
|
|
|
scalar $self->NamedObjects('0', $_[0]) if defined $_[0];
|
92
|
|
|
|
|
|
|
}
|
93
|
0
|
|
|
|
|
|
$self->reportTraceInfo();#(shift, caller(1));
|
94
|
0
|
|
|
|
|
|
return @_;
|
95
|
|
|
|
|
|
|
}
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
### ###########################################################################
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 AUTHOR
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Glenn Wood,
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 COPYRIGHT
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Copyright (C) 2004 Glenn Wood. All rights reserved.
|
107
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
108
|
|
|
|
|
|
|
modify it under the same terms as Perl itself.
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |