← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:21 2010

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Memcached/libmemcached/API.pm
Statements Executed 21
Statement Execution Time 884µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11176µs76µsMemcached::libmemcached::API::::libmemcached_tagsMemcached::libmemcached::API::libmemcached_tags
22243µs43µsMemcached::libmemcached::API::::CORE:sortMemcached::libmemcached::API::CORE:sort (opcode)
11115µs15µsMemcached::libmemcached::API::::libmemcached_constantsMemcached::libmemcached::API::libmemcached_constants
11113µs50µsMemcached::libmemcached::API::::BEGIN@23Memcached::libmemcached::API::BEGIN@23
11110µs10µsMemcached::libmemcached::API::::libmemcached_functionsMemcached::libmemcached::API::libmemcached_functions
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Memcached::libmemcached::API;
2
3=head1 NAME
4
5Memcached::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
17This module should be considered private. It may change or be removed in future.
18
19=head1 FUNCTIONS
20
21=cut
22
233200µs286µ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
use base qw(Exporter);
# spent 50µs making 1 call to Memcached::libmemcached::API::BEGIN@23 # spent 37µs making 1 call to base::import
2412µsour @EXPORT = qw(
25 libmemcached_functions
26 libmemcached_constants
27 libmemcached_tags
28);
29
30# load hash of libmemcached functions created by Makefile.PL
311154µsmy $libmemcached_funcs = require "Memcached/libmemcached/func_hash.pl";
3212µsdie "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
3712µsmy %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
4411µsmy %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
56118µsour @libmemcached_funcs = do {
57117µs my %funcs = (
58 %$libmemcached_funcs,
59 %libmemcached_extra_functions,
60 %libmemcached_unimplemented_functions
61 );
62149µs117µs 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
671255µsmy $libmemcached_consts = require "Memcached/libmemcached/const_hash.pl";
6816µsdie "Memcached/libmemcached/const_hash.pl failed sanity check"
69 unless ref $libmemcached_consts eq 'HASH'
70 and keys %$libmemcached_consts > 20;
71
72162µs126µsour @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
79Returns a list of all the public functions in the libmemcached library.
80
81=cut
82
83114µ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
sub libmemcached_functions { @libmemcached_funcs }
84
85
86=head2 libmemcached_constants
87
88 @names = libmemcached_constants();
89
90Returns a list of all the constants in the libmemcached library.
91
92=cut
93
94117µ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
sub libmemcached_constants { @libmemcached_consts }
95
96
97=head2 libmemcached_tags
98
99 @tags = libmemcached_tags();
100
101Returns 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
sub libmemcached_tags {
106465µs my %tags;
107 push @{ $tags{ $libmemcached_consts->{$_} } }, $_
108 for keys %$libmemcached_consts;
109 #use Data::Dumper; warn Dumper(\%tags);
110 return %tags;
111}
112
113122µs1;
# 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
sub Memcached::libmemcached::API::CORE:sort; # xsub