line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
563
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
3
|
|
|
|
|
|
|
package Mojo::JSONXS; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: provide faster JSON for Mojolicious apps using Cpanel::JSON::XS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1128
|
use Cpanel::JSON::XS; |
|
1
|
|
|
|
|
3201
|
|
|
1
|
|
|
|
|
75
|
|
9
|
1
|
|
|
1
|
|
447
|
use Mojo::JSON; |
|
1
|
|
|
|
|
62281
|
|
|
1
|
|
|
|
|
47
|
|
10
|
1
|
|
|
1
|
|
7
|
use Mojo::Util 'monkey_patch'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
193
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $BINARY = Cpanel::JSON::XS->new->utf8(1)->allow_nonref(1)->allow_blessed(1)->convert_blessed(1); |
13
|
|
|
|
|
|
|
my $TEXT = Cpanel::JSON::XS->new->utf8(0)->allow_nonref(1)->allow_blessed(1)->convert_blessed(1); |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
|
|
monkey_patch 'Mojo::JSON', 'encode_json', sub { $BINARY->encode(shift) }; |
16
|
0
|
|
|
0
|
|
|
monkey_patch 'Mojo::JSON', 'decode_json', sub { $BINARY->decode(shift) }; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
|
|
monkey_patch 'Mojo::JSON', 'to_json', sub { $TEXT->encode(shift) }; |
19
|
0
|
|
|
0
|
|
|
monkey_patch 'Mojo::JSON', 'from_json', sub { $TEXT->decode(shift) }; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
0
|
|
|
monkey_patch 'Mojo::JSON', 'true()', sub { Cpanel::JSON::XS::true() }; |
22
|
0
|
|
|
0
|
|
|
monkey_patch 'Mojo::JSON', 'false()', sub { Cpanel::JSON::XS::false() }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |