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.85 by root, Wed Mar 19 02:55:23 2008 UTC vs.
Revision 1.87 by root, Wed Mar 19 13:25:26 2008 UTC

1111about three times faster on decoding, and over forty times faster 1111about three times faster on decoding, and over forty times faster
1112than JSON, even with pretty-printing and key sorting. It also compares 1112than JSON, even with pretty-printing and key sorting. It also compares
1113favourably to Storable for small amounts of data. 1113favourably to Storable for small amounts of data.
1114 1114
1115Using a longer test string (roughly 18KB, generated from Yahoo! Locals 1115Using a longer test string (roughly 18KB, generated from Yahoo! Locals
1116search API (http://nanoref.com/yahooapis/mgPdGg): 1116search API (http://dist.schmorp.de/misc/yahoo.json).
1117 1117
1118 module | encode | decode | 1118 module | encode | decode |
1119 -----------|------------|------------| 1119 -----------|------------|------------|
1120 JSON 1.x | 55.260 | 34.971 | 1120 JSON 1.x | 55.260 | 34.971 |
1121 JSON::DWIW | 825.228 | 1082.513 | 1121 JSON::DWIW | 825.228 | 1082.513 |
1163to free the temporary). If that is exceeded, the program crashes. To be 1163to free the temporary). If that is exceeded, the program crashes. To be
1164conservative, the default nesting limit is set to 512. If your process 1164conservative, the default nesting limit is set to 512. If your process
1165has a smaller stack, you should adjust this setting accordingly with the 1165has a smaller stack, you should adjust this setting accordingly with the
1166C<max_depth> method. 1166C<max_depth> method.
1167 1167
1168And last but least, something else could bomb you that I forgot to think 1168Something else could bomb you, too, that I forgot to think of. In that
1169of. In that case, you get to keep the pieces. I am always open for hints, 1169case, you get to keep the pieces. I am always open for hints, though...
1170though... 1170
1171Also keep in mind that JSON::XS might leak contents of your Perl data
1172structures in its error messages, so when you serialise sensitive
1173information you might want to make sure that exceptions thrown by JSON::XS
1174will not end up in front of untrusted eyes.
1171 1175
1172If you are using JSON::XS to return packets to consumption 1176If you are using JSON::XS to return packets to consumption
1173by JavaScript scripts in a browser you should have a look at 1177by JavaScript scripts in a browser you should have a look at
1174L<http://jpsykes.com/47/practical-csrf-and-json-security> to see whether 1178L<http://jpsykes.com/47/practical-csrf-and-json-security> to see whether
1175you are vulnerable to some common attack vectors (which really are browser 1179you are vulnerable to some common attack vectors (which really are browser

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines