ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.pm
(Generate patch)

Comparing JSON-XS/XS.pm (file contents):
Revision 1.87 by root, Wed Mar 19 13:25:26 2008 UTC vs.
Revision 1.88 by root, Wed Mar 19 13:44:41 2008 UTC

1081It seems that JSON::XS is surprisingly fast, as shown in the following 1081It seems that JSON::XS is surprisingly fast, as shown in the following
1082tables. They have been generated with the help of the C<eg/bench> program 1082tables. They have been generated with the help of the C<eg/bench> program
1083in the JSON::XS distribution, to make it easy to compare on your own 1083in the JSON::XS distribution, to make it easy to compare on your own
1084system. 1084system.
1085 1085
1086First comes a comparison between various modules using a very short 1086First comes a comparison between various modules using
1087single-line JSON string: 1087a very short single-line JSON string (also available at
1088L<http://dist.schmorp.de/misc/json/long.json>).
1088 1089
1089 {"method": "handleMessage", "params": ["user1", "we were just talking"], \ 1090 {"method": "handleMessage", "params": ["user1", "we were just talking"], \
1090 "id": null, "array":[1,11,234,-5,1e5,1e7, true, false]} 1091 "id": null, "array":[1,11,234,-5,1e5,1e7, true, false]}
1091 1092
1092It shows the number of encodes/decodes per second (JSON::XS uses 1093It shows the number of encodes/decodes per second (JSON::XS uses
1111about three times faster on decoding, and over forty times faster 1112about three times faster on decoding, and over forty times faster
1112than JSON, even with pretty-printing and key sorting. It also compares 1113than JSON, even with pretty-printing and key sorting. It also compares
1113favourably to Storable for small amounts of data. 1114favourably to Storable for small amounts of data.
1114 1115
1115Using a longer test string (roughly 18KB, generated from Yahoo! Locals 1116Using a longer test string (roughly 18KB, generated from Yahoo! Locals
1116search API (http://dist.schmorp.de/misc/yahoo.json). 1117search API (L>http://dist.schmorp.de/misc/json/long.json>).
1117 1118
1118 module | encode | decode | 1119 module | encode | decode |
1119 -----------|------------|------------| 1120 -----------|------------|------------|
1120 JSON 1.x | 55.260 | 34.971 | 1121 JSON 1.x | 55.260 | 34.971 |
1121 JSON::DWIW | 825.228 | 1082.513 | 1122 JSON::DWIW | 825.228 | 1082.513 |

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines