Filename | /usr/lib/perl5/Readonly/XS.pm |
Statements | Executed 24 statements in 437µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 13µs | 16µs | BEGIN@18 | Readonly::XS::
1 | 1 | 1 | 12µs | 12µs | import | Readonly::XS::
2 | 1 | 1 | 11µs | 11µs | is_sv_readonly (xsub) | Readonly::XS::
1 | 1 | 1 | 9µs | 24µs | BEGIN@32 | Readonly::XS::
1 | 1 | 1 | 6µs | 11µs | BEGIN@19 | Readonly::XS::
1 | 1 | 1 | 6µs | 18µs | BEGIN@45 | Readonly::XS::
1 | 1 | 1 | 6µs | 15µs | BEGIN@46 | Readonly::XS::
1 | 1 | 1 | 6µs | 42µs | BEGIN@20 | Readonly::XS::
1 | 1 | 1 | 3µs | 3µs | BEGIN@31 | Readonly::XS::
2 | 1 | 1 | 1µs | 1µs | make_sv_readonly (xsub) | Readonly::XS::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | =for gpg | ||||
2 | -----BEGIN PGP SIGNED MESSAGE----- | ||||
3 | Hash: SHA1 | ||||
4 | |||||
5 | =head1 NAME | ||||
6 | |||||
7 | Readonly::XS - Companion module for Readonly.pm, to speed up read-only | ||||
8 | scalar variables. | ||||
9 | |||||
10 | =head1 VERSION | ||||
11 | |||||
12 | This document describes version 1.04 of Readonly::XS, December 6, 2005. | ||||
13 | |||||
14 | =cut | ||||
15 | |||||
16 | package Readonly::XS; | ||||
17 | |||||
18 | 2 | 23µs | 2 | 20µs | # spent 16µs (13+3) within Readonly::XS::BEGIN@18 which was called:
# once (13µs+3µs) by Readonly::BEGIN@2 at line 18 # spent 16µs making 1 call to Readonly::XS::BEGIN@18
# spent 3µs making 1 call to strict::import |
19 | 2 | 23µs | 2 | 16µs | # spent 11µs (6+5) within Readonly::XS::BEGIN@19 which was called:
# once (6µs+5µs) by Readonly::BEGIN@2 at line 19 # spent 11µs making 1 call to Readonly::XS::BEGIN@19
# spent 5µs making 1 call to warnings::import |
20 | 2 | 55µs | 2 | 77µs | # spent 42µs (6+36) within Readonly::XS::BEGIN@20 which was called:
# once (6µs+36µs) by Readonly::BEGIN@2 at line 20 # spent 42µs making 1 call to Readonly::XS::BEGIN@20
# spent 36µs making 1 call to vars::import |
21 | |||||
22 | 1 | 500ns | $VERSION = '1.04'; | ||
23 | |||||
24 | 1 | 500ns | require XSLoader; | ||
25 | 1 | 170µs | 1 | 163µs | XSLoader::load('Readonly::XS', $VERSION); # spent 163µs making 1 call to XSLoader::load |
26 | |||||
27 | |||||
28 | # It is an error to use this from any module but Readonly. | ||||
29 | # But sooner or later, someone will. | ||||
30 | BEGIN | ||||
31 | # spent 3µs within Readonly::XS::BEGIN@31 which was called:
# once (3µs+0s) by Readonly::BEGIN@2 at line 38 | ||||
32 | 2 | 40µs | 2 | 40µs | # spent 24µs (9+15) within Readonly::XS::BEGIN@32 which was called:
# once (9µs+15µs) by Readonly::BEGIN@2 at line 32 # spent 24µs making 1 call to Readonly::XS::BEGIN@32
# spent 15µs making 1 call to warnings::unimport |
33 | 1 | 4µs | if ($MAGIC_COOKIE ne "Do NOT use or require Readonly::XS unless you're me.") | ||
34 | { | ||||
35 | require Carp; | ||||
36 | Carp::croak("Readonly::XS is not a standalone module. You should not use it directly."); | ||||
37 | } | ||||
38 | 1 | 33µs | 1 | 3µs | } # spent 3µs making 1 call to Readonly::XS::BEGIN@31 |
39 | |||||
40 | sub import | ||||
41 | # spent 12µs within Readonly::XS::import which was called:
# once (12µs+0s) by Readonly::BEGIN@2 at line 2 of (eval 216)[Readonly.pm:42] | ||||
42 | 3 | 4µs | my $func; | ||
43 | for $func (qw/is_sv_readonly make_sv_readonly/) | ||||
44 | { | ||||
45 | 2 | 22µs | 2 | 30µs | # spent 18µs (6+12) within Readonly::XS::BEGIN@45 which was called:
# once (6µs+12µs) by Readonly::BEGIN@2 at line 45 # spent 18µs making 1 call to Readonly::XS::BEGIN@45
# spent 12µs making 1 call to strict::unimport |
46 | 2 | 49µs | 2 | 25µs | # spent 15µs (6+9) within Readonly::XS::BEGIN@46 which was called:
# once (6µs+9µs) by Readonly::BEGIN@2 at line 46 # spent 15µs making 1 call to Readonly::XS::BEGIN@46
# spent 9µs making 1 call to warnings::unimport |
47 | 4 | 9µs | *{"Readonly::$func"} = \&$func; | ||
48 | } | ||||
49 | $Readonly::XSokay = 1; | ||||
50 | } | ||||
51 | |||||
52 | |||||
53 | 1 | 4µs | 1; | ||
54 | __END__ | ||||
# spent 11µs within Readonly::XS::is_sv_readonly which was called 2 times, avg 6µs/call:
# 2 times (11µs+0s) by Readonly::Scalar at line 248 of Readonly.pm, avg 6µs/call | |||||
# spent 1µs within Readonly::XS::make_sv_readonly which was called 2 times, avg 700ns/call:
# 2 times (1µs+0s) by Readonly::Scalar at line 266 of Readonly.pm, avg 700ns/call |