Filename | /usr/share/perl5/JSON/PP58.pm |
Statements | Executed 15 statements in 413µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 36µs | 36µs | BEGIN@3 | JSON::PP58::
1 | 1 | 1 | 22µs | 22µs | BEGIN@11 | JSON::PP58::
1 | 1 | 1 | 13µs | 25µs | BEGIN@4 | JSON::PP58::
0 | 0 | 0 | 0s | 0s | incr_parse | JSON::PP::
0 | 0 | 0 | 0s | 0s | incr_reset | JSON::PP::
0 | 0 | 0 | 0s | 0s | incr_skip | JSON::PP::
0 | 0 | 0 | 0s | 0s | incr_text | JSON::PP::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package JSON::PP58; | ||||
2 | |||||
3 | 3 | 54µs | 1 | 36µs | # spent 36µs within JSON::PP58::BEGIN@3 which was called:
# once (36µs+0s) by JSON::PP::BEGIN@43 at line 3 # spent 36µs making 1 call to JSON::PP58::BEGIN@3 |
4 | 3 | 166µs | 2 | 37µs | # spent 25µs (13+12) within JSON::PP58::BEGIN@4 which was called:
# once (13µs+12µs) by JSON::PP::BEGIN@43 at line 4 # spent 25µs making 1 call to JSON::PP58::BEGIN@4
# spent 12µs making 1 call to strict::import |
5 | |||||
6 | 1 | 300ns | my @properties; | ||
7 | |||||
8 | 1 | 700ns | $JSON::PP58::VERSION = '1.03'; | ||
9 | |||||
10 | |||||
11 | # spent 22µs within JSON::PP58::BEGIN@11 which was called:
# once (22µs+0s) by JSON::PP::BEGIN@43 at line 38 | ||||
12 | |||||
13 | 1 | 1µs | unless ( defined &utf8::is_utf8 ) { | ||
14 | require Encode; | ||||
15 | *utf8::is_utf8 = *Encode::is_utf8; | ||||
16 | } | ||||
17 | |||||
18 | 1 | 6µs | *JSON::PP::JSON_PP_encode_ascii = \&JSON::PP::_encode_ascii; | ||
19 | 1 | 3µs | *JSON::PP::JSON_PP_encode_latin1 = \&JSON::PP::_encode_latin1; | ||
20 | 1 | 3µs | *JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates; | ||
21 | 1 | 3µs | *JSON::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode; | ||
22 | |||||
23 | 1 | 7µs | if ($] >= 5.008 and $] < 5.008003) { # join() in 5.8.0 - 5.8.2 is broken. | ||
24 | package JSON::PP; | ||||
25 | require subs; | ||||
26 | subs->import('join'); | ||||
27 | eval q| | ||||
28 | sub join { | ||||
29 | return '' if (@_ < 2); | ||||
30 | my $j = shift; | ||||
31 | my $str = shift; | ||||
32 | for (@_) { $str .= $j . $_; } | ||||
33 | return $str; | ||||
34 | } | ||||
35 | |; | ||||
36 | } | ||||
37 | |||||
38 | 1 | 166µs | 1 | 22µs | } # spent 22µs making 1 call to JSON::PP58::BEGIN@11 |
39 | |||||
40 | |||||
41 | sub JSON::PP::incr_parse { | ||||
42 | local $Carp::CarpLevel = 1; | ||||
43 | ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_parse( @_ ); | ||||
44 | } | ||||
45 | |||||
46 | |||||
47 | sub JSON::PP::incr_text : lvalue { | ||||
48 | $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new; | ||||
49 | |||||
50 | if ( $_[0]->{_incr_parser}->{incr_parsing} ) { | ||||
51 | Carp::croak("incr_text can not be called when the incremental parser already started parsing"); | ||||
52 | } | ||||
53 | $_[0]->{_incr_parser}->{incr_text}; | ||||
54 | } | ||||
55 | |||||
56 | |||||
57 | sub JSON::PP::incr_skip { | ||||
58 | ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_skip; | ||||
59 | } | ||||
60 | |||||
61 | |||||
62 | sub JSON::PP::incr_reset { | ||||
63 | ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_reset; | ||||
64 | } | ||||
65 | |||||
66 | |||||
67 | 1 | 3µs | 1; | ||
68 | __END__ |