Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Any/URI/Escape.pm |
Statements | Executed 19 statements in 159µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 38µs | 38µs | BEGIN@17 | Any::URI::Escape::
1 | 1 | 1 | 8µs | 9µs | BEGIN@3 | Any::URI::Escape::
1 | 1 | 1 | 5µs | 54µs | BEGIN@14 | Any::URI::Escape::
1 | 1 | 1 | 4µs | 7µs | BEGIN@4 | Any::URI::Escape::
1 | 1 | 1 | 4µs | 15µs | BEGIN@33 | Any::URI::Escape::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Any::URI::Escape; | ||||
2 | |||||
3 | 2 | 13µs | 2 | 10µs | # spent 9µs (8+1) within Any::URI::Escape::BEGIN@3 which was called:
# once (8µs+1µs) by Search::Elasticsearch::Role::Client::Direct::BEGIN@9 at line 3 # spent 9µs making 1 call to Any::URI::Escape::BEGIN@3
# spent 1µs making 1 call to strict::import |
4 | 2 | 22µs | 2 | 10µs | # spent 7µs (4+3) within Any::URI::Escape::BEGIN@4 which was called:
# once (4µs+3µs) by Search::Elasticsearch::Role::Client::Direct::BEGIN@9 at line 4 # spent 7µs making 1 call to Any::URI::Escape::BEGIN@4
# spent 3µs making 1 call to warnings::import |
5 | |||||
6 | 1 | 100ns | our $VERSION = 0.01; | ||
7 | |||||
8 | =head1 NAME | ||||
9 | |||||
10 | Any::URI::Escape - Load URI::Escape::XS preferentially over URI::Escape | ||||
11 | |||||
12 | =cut | ||||
13 | |||||
14 | 2 | 44µs | 2 | 104µs | # spent 54µs (5+49) within Any::URI::Escape::BEGIN@14 which was called:
# once (5µs+49µs) by Search::Elasticsearch::Role::Client::Direct::BEGIN@9 at line 14 # spent 54µs making 1 call to Any::URI::Escape::BEGIN@14
# spent 49µs making 1 call to base::import |
15 | 1 | 700ns | our @EXPORT = qw( uri_escape uri_unescape ); | ||
16 | |||||
17 | # spent 38µs within Any::URI::Escape::BEGIN@17 which was called:
# once (38µs+0s) by Search::Elasticsearch::Role::Client::Direct::BEGIN@9 at line 37 | ||||
18 | |||||
19 | 1 | 12µs | eval 'require URI::Escape::XS'; # spent 17µs executing statements in string eval | ||
20 | |||||
21 | 1 | 100ns | my $pkg; | ||
22 | 1 | 200ns | if ($@) { | ||
23 | |||||
24 | # xs version not installed, use URI::Escape | ||||
25 | 1 | 600ns | require URI::Escape; | ||
26 | 1 | 200ns | $pkg = 'URI::Escape'; | ||
27 | |||||
28 | } | ||||
29 | else { | ||||
30 | |||||
31 | $pkg = 'URI::Escape::XS'; | ||||
32 | } | ||||
33 | 2 | 34µs | 2 | 26µs | # spent 15µs (4+11) within Any::URI::Escape::BEGIN@33 which was called:
# once (4µs+11µs) by Search::Elasticsearch::Role::Client::Direct::BEGIN@9 at line 33 # spent 15µs making 1 call to Any::URI::Escape::BEGIN@33
# spent 11µs making 1 call to strict::unimport |
34 | 1 | 200ns | my $class = __PACKAGE__; | ||
35 | 1 | 4µs | *{"$class\::uri_escape"} = *{"$pkg\::uri_escape"}; | ||
36 | 1 | 5µs | *{"$class\::uri_unescape"} = *{"$pkg\::uri_unescape"}; | ||
37 | 1 | 21µs | 1 | 38µs | } # spent 38µs making 1 call to Any::URI::Escape::BEGIN@17 |
38 | |||||
39 | |||||
40 | 1 | 2µs | 1; | ||
41 | |||||
42 | =head1 SYNOPSIS | ||||
43 | |||||
44 | use Any::URI::Escape; | ||||
45 | $escaped_url = uri_escape($url); | ||||
46 | |||||
47 | # URI::Escape::XS will be used instead of URI::Escape if it is installed. | ||||
48 | |||||
49 | =head1 DESCRIPTION | ||||
50 | |||||
51 | URI::Escape is great, but URI::Escape::XS is faster. This module loads | ||||
52 | URI::Escape::XS and imports the two most common methods if XS is installed. | ||||
53 | |||||
54 | The insides of this module aren't completely shaken out yet, so patches | ||||
55 | welcome. | ||||
56 | |||||
57 | =head1 SEE ALSO | ||||
58 | |||||
59 | L<URI::Escape> | ||||
60 | |||||
61 | L<URI::Escape::XS> | ||||
62 | |||||
63 | =head1 AUTHOR | ||||
64 | |||||
65 | Fred Moyer, E<lt>fred@redhotpenguin.comE<gt> | ||||
66 | |||||
67 | =head1 COPYRIGHT AND LICENSE | ||||
68 | |||||
69 | Copyright (C) 2010 by Fred Moyer | ||||
70 | |||||
71 | This library is free software; you can redistribute it and/or modify | ||||
72 | it under the same terms as Perl itself, either Perl version 5.12.0 or, | ||||
73 | at your option, any later version of Perl 5 you may have available. | ||||
74 | |||||
75 | |||||
76 | =cut |