… | |
… | |
45 | |
45 | |
46 | In short, CBOR is a faster and very compact binary alternative to JSON, |
46 | In short, CBOR is a faster and very compact binary alternative to JSON, |
47 | with the added ability of supporting serialisation of Perl objects. (JSON |
47 | with the added ability of supporting serialisation of Perl objects. (JSON |
48 | often compresses better than CBOR though, so if you plan to compress the |
48 | often compresses better than CBOR though, so if you plan to compress the |
49 | data later you might want to compare both formats first). |
49 | data later you might want to compare both formats first). |
|
|
50 | |
|
|
51 | To give you a general idea, with texts in the megabyte range, C<CBOR::XS> |
|
|
52 | usually encodes roughly twice as fast as L<Storable> or L<JSON::XS> and |
|
|
53 | decodes about 15%-30% faster than those. The shorter the data, the worse |
|
|
54 | L<Storable> performs in comparison. |
50 | |
55 | |
51 | The primary goal of this module is to be I<correct> and the secondary goal |
56 | The primary goal of this module is to be I<correct> and the secondary goal |
52 | is to be I<fast>. To reach the latter goal it was written in C. |
57 | is to be I<fast>. To reach the latter goal it was written in C. |
53 | |
58 | |
54 | See MAPPING, below, on how CBOR::XS maps perl values to CBOR values and |
59 | See MAPPING, below, on how CBOR::XS maps perl values to CBOR values and |