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