File | /project/perl/lib/version.pm |
Statements Executed | 27 |
Statement Execution Time | 1.86ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 2 | 2 | 118µs | 118µs | import | version::
2 | 2 | 2 | 86µs | 462µs | __ANON__[:32] | version::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | #!perl -w | ||||
2 | package version; | ||||
3 | |||||
4 | 3 | 67µs | use 5.005_04; | ||
5 | 3 | 95µs | 1 | 23µs | use strict; # spent 23µs making 1 call to strict::import |
6 | |||||
7 | 3 | 309µs | 1 | 355µs | use vars qw(@ISA $VERSION $CLASS *qv); # spent 355µs making 1 call to vars::import |
8 | |||||
9 | 1 | 5µs | $VERSION = "0.70"; | ||
10 | |||||
11 | 1 | 6µs | $CLASS = 'version'; | ||
12 | |||||
13 | 1 | 488µs | 1 | 151µs | eval "use version::vxs $VERSION"; # spent 151µs making 1 call to version::vxs::VERSION |
14 | 3 | 27µs | if ( $@ ) { # don't have the XS version installed | ||
15 | eval "use version::vpp $VERSION"; # don't tempt fate | ||||
16 | die "$@" if ( $@ ); | ||||
17 | push @ISA, "version::vpp"; | ||||
18 | *version::qv = \&version::vpp::qv; | ||||
19 | } | ||||
20 | else { # use XS module | ||||
21 | push @ISA, "version::vxs"; | ||||
22 | *version::qv = \&version::vxs::qv; | ||||
23 | } | ||||
24 | |||||
25 | # Preloaded methods go here. | ||||
26 | # spent 118µs within version::import which was called 2 times, avg 59µs/call:
# once (75µs+0s) by DBI::install_driver at line 20 of DBD/Pg.pm
# once (43µs+0s) by base::import at line 10 of Class/DBI.pm | ||||
27 | 6 | 135µs | my ($class) = shift; | ||
28 | my $callpkg = caller(); | ||||
29 | 3 | 238µs | 1 | 96µs | no strict 'refs'; # spent 96µs making 1 call to strict::unimport |
30 | |||||
31 | 2 | 466µs | 2 | 376µs | *{$callpkg."::qv"} = # spent 376µs making 2 calls to version::vxs::qv, avg 188µs/call |
32 | # spent 462µs (86+376) within version::__ANON__[/project/perl/lib/version.pm:32] which was called 2 times, avg 231µs/call:
# once (44µs+192µs) by base::import at line 10 of Class/DBI.pm
# once (42µs+184µs) by DBI::install_driver at line 20 of DBD/Pg.pm | ||||
33 | unless defined(&{"$callpkg\::qv"}); | ||||
34 | |||||
35 | # if (@_) { # must have initialization on the use line | ||||
36 | # if ( defined $_[2] ) { # CVS style | ||||
37 | # $_[0] = version::qv($_[2]); | ||||
38 | # } | ||||
39 | # else { | ||||
40 | # $_[0] = version->new($_[1]); | ||||
41 | # } | ||||
42 | # } | ||||
43 | } | ||||
44 | |||||
45 | 1 | 20µs | 1; |