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