File | /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Memcached/libmemcached/API.pm |
Statements Executed | 22 |
Statement Execution Time | 884µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 76µs | 76µs | libmemcached_tags | Memcached::libmemcached::API::
2 | 2 | 2 | 43µs | 43µs | CORE:sort (opcode) | Memcached::libmemcached::API::
1 | 1 | 1 | 15µs | 15µs | libmemcached_constants | Memcached::libmemcached::API::
1 | 1 | 1 | 13µs | 50µs | BEGIN@23 | Memcached::libmemcached::API::
1 | 1 | 1 | 10µs | 10µs | libmemcached_functions | Memcached::libmemcached::API::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Memcached::libmemcached::API; | ||||
2 | |||||
3 | =head1 NAME | ||||
4 | |||||
5 | Memcached::libmemcached::API - | ||||
6 | |||||
7 | =head1 SYNOPSIS | ||||
8 | |||||
9 | use Memcached::libmemcached::API; | ||||
10 | |||||
11 | @function_names = libmemcached_functions(); | ||||
12 | @constant_names = libmemcached_constants(); | ||||
13 | @EXPORT_TAGS = libmemcached_tags(); | ||||
14 | |||||
15 | =head1 DESCRIPTION | ||||
16 | |||||
17 | This module should be considered private. It may change or be removed in future. | ||||
18 | |||||
19 | =head1 FUNCTIONS | ||||
20 | |||||
21 | =cut | ||||
22 | |||||
23 | 3 | 200µs | 2 | 86µs | # spent 50µs (13+36) within Memcached::libmemcached::API::BEGIN@23 which was called
# once (13µs+36µs) by Memcached::libmemcached::BEGIN@21 at line 23 # spent 50µs making 1 call to Memcached::libmemcached::API::BEGIN@23
# spent 37µs making 1 call to base::import |
24 | 1 | 2µs | our @EXPORT = qw( | ||
25 | libmemcached_functions | ||||
26 | libmemcached_constants | ||||
27 | libmemcached_tags | ||||
28 | ); | ||||
29 | |||||
30 | # load hash of libmemcached functions created by Makefile.PL | ||||
31 | 1 | 154µs | my $libmemcached_funcs = require "Memcached/libmemcached/func_hash.pl"; | ||
32 | 1 | 2µs | die "Memcached/libmemcached/func_hash.pl failed sanity check" | ||
33 | unless ref $libmemcached_funcs eq 'HASH' | ||||
34 | and keys %$libmemcached_funcs > 20; | ||||
35 | |||||
36 | # extra functions provided by Memcached::libmemcached | ||||
37 | 1 | 2µs | my %libmemcached_extra_functions = ( | ||
38 | memcached_errstr => 1, | ||||
39 | memcached_mget_into_hashref => 1, | ||||
40 | memcached_set_callback_coderefs => 1, | ||||
41 | ); | ||||
42 | |||||
43 | # functions we don't provide an API for | ||||
44 | 1 | 1µs | my %libmemcached_unimplemented_functions = ( | ||
45 | # inappropriate for perl | ||||
46 | memcached_callback_get => 0, | ||||
47 | memcached_callback_set => 0, | ||||
48 | # memcached_server_st | ||||
49 | memcached_server_push => 0, | ||||
50 | memcached_servers_parse => 0, | ||||
51 | memcached_server_list_append => 0, | ||||
52 | memcached_server_list_free => 0, | ||||
53 | ); | ||||
54 | |||||
55 | # build complete list of implemented functions | ||||
56 | 3 | 83µs | our @libmemcached_funcs = do { | ||
57 | my %funcs = ( | ||||
58 | %$libmemcached_funcs, | ||||
59 | %libmemcached_extra_functions, | ||||
60 | %libmemcached_unimplemented_functions | ||||
61 | ); | ||||
62 | grep { $funcs{$_} } sort keys %funcs; # spent 17µs making 1 call to Memcached::libmemcached::API::CORE:sort | ||||
63 | }; | ||||
64 | |||||
65 | |||||
66 | # load hash of libmemcached functions created by Makefile.PL | ||||
67 | 1 | 255µs | my $libmemcached_consts = require "Memcached/libmemcached/const_hash.pl"; | ||
68 | 1 | 6µs | die "Memcached/libmemcached/const_hash.pl failed sanity check" | ||
69 | unless ref $libmemcached_consts eq 'HASH' | ||||
70 | and keys %$libmemcached_consts > 20; | ||||
71 | |||||
72 | 1 | 62µs | 1 | 26µs | our @libmemcached_consts = sort keys %$libmemcached_consts; # spent 26µs making 1 call to Memcached::libmemcached::API::CORE:sort |
73 | |||||
74 | |||||
75 | =head2 libmemcached_functions | ||||
76 | |||||
77 | @names = libmemcached_functions(); | ||||
78 | |||||
79 | Returns a list of all the public functions in the libmemcached library. | ||||
80 | |||||
81 | =cut | ||||
82 | |||||
83 | 1 | 14µs | # spent 10µs within Memcached::libmemcached::API::libmemcached_functions which was called
# once (10µs+0s) by SimpleDB::Class::Cache::BEGIN@31 at line 22 of Memcached/libmemcached.pm | ||
84 | |||||
85 | |||||
86 | =head2 libmemcached_constants | ||||
87 | |||||
88 | @names = libmemcached_constants(); | ||||
89 | |||||
90 | Returns a list of all the constants in the libmemcached library. | ||||
91 | |||||
92 | =cut | ||||
93 | |||||
94 | 1 | 17µs | # spent 15µs within Memcached::libmemcached::API::libmemcached_constants which was called
# once (15µs+0s) by SimpleDB::Class::Cache::BEGIN@31 at line 22 of Memcached/libmemcached.pm | ||
95 | |||||
96 | |||||
97 | =head2 libmemcached_tags | ||||
98 | |||||
99 | @tags = libmemcached_tags(); | ||||
100 | |||||
101 | Returns a hash list of pairs of tag name and array references suitable for setting %EXPORT_TAGS. | ||||
102 | |||||
103 | =cut | ||||
104 | |||||
105 | # spent 76µs within Memcached::libmemcached::API::libmemcached_tags which was called
# once (76µs+0s) by SimpleDB::Class::Cache::BEGIN@31 at line 26 of Memcached/libmemcached.pm | ||||
106 | 4 | 18µs | my %tags; | ||
107 | push @{ $tags{ $libmemcached_consts->{$_} } }, $_ | ||||
108 | for keys %$libmemcached_consts; | ||||
109 | #use Data::Dumper; warn Dumper(\%tags); | ||||
110 | 1 | 47µs | return %tags; | ||
111 | } | ||||
112 | |||||
113 | 1 | 22µs | 1; | ||
# spent 43µs within Memcached::libmemcached::API::CORE:sort which was called 2 times, avg 21µs/call:
# once (26µs+0s) by Memcached::libmemcached::BEGIN@21 at line 72 of Memcached/libmemcached/API.pm
# once (17µs+0s) by Memcached::libmemcached::BEGIN@21 at line 62 of Memcached/libmemcached/API.pm |