--- JSON-XS/XS.pm 2007/06/06 14:52:49 1.37 +++ JSON-XS/XS.pm 2007/06/06 18:16:52 1.38 @@ -88,7 +88,7 @@ use strict; BEGIN { - our $VERSION = '1.22'; + our $VERSION = '1.23'; our @ISA = qw(Exporter); our @EXPORT = qw(to_json from_json objToJson jsonToObj); @@ -618,27 +618,26 @@ single-line JSON string: {"method": "handleMessage", "params": ["user1", "we were just talking"], \ - "id": null, [1,11,234,-5,1e5,1e7, true, false]} + "id": null, "array":[1,11,234,-5,1e5,1e7, true, false]} It shows the number of encodes/decodes per second (JSON::XS uses the functional interface, while JSON::XS/2 uses the OO interface with pretty-printing and hashkey sorting enabled). Higher is better: - -----------+------------+------------+ module | encode | decode | -----------|------------|------------| - JSON | 10597.029 | 5740.903 | - JSON::DWIW | 78251.940 | 98457.840 | - JSON::PC | 70611.178 | 92794.336 | - JSON::Syck | 28767.517 | 38199.490 | - JSON::XS | 419430.400 | 265462.278 | - JSON::XS/2 | 279620.267 | 265462.278 | - JSON::XS/3 | 388361.481 | 265462.278 | - Storable | 16294.887 | 16844.594 | + JSON | 7645.468 | 4208.613 | + JSON::DWIW | 68534.379 | 79437.576 | + JSON::PC | 65948.176 | 78251.940 | + JSON::Syck | 23379.621 | 28416.694 | + JSON::XS | 388361.481 | 199728.762 | + JSON::XS/2 | 218453.333 | 192399.266 | + JSON::XS/3 | 338250.323 | 192399.266 | + Storable | 15732.573 | 28571.553 | -----------+------------+------------+ That is, JSON::XS is about five times faster than JSON::DWIW on encoding, -about three times faster on decoding, and about fourty times faster +about three times faster on decoding, and over fourty times faster than JSON, even with pretty-printing and key sorting. It also compares favourably to Storable for small amounts of data.