… | |
… | |
224 | |
224 | |
225 | Perl usually over-allocates memory a bit when allocating space for |
225 | Perl usually over-allocates memory a bit when allocating space for |
226 | strings. This flag optionally resizes strings generated by either |
226 | strings. This flag optionally resizes strings generated by either |
227 | C<encode> or C<decode> to their minimum size possible. This can save |
227 | C<encode> or C<decode> to their minimum size possible. This can save |
228 | memory when your JSON strings are either very very long or you have many |
228 | memory when your JSON strings are either very very long or you have many |
229 | short strings. |
229 | short strings. It will also try to downgrade any strings to octet-form |
|
|
230 | if possible: perl stores strings internally either in an encoding called |
|
|
231 | UTF-X or in octet-form. The latter cannot store everything but uses less |
|
|
232 | space in general. |
230 | |
233 | |
231 | If C<$enable> is true (or missing), the string returned by C<encode> will be shrunk-to-fit, |
234 | If C<$enable> is true (or missing), the string returned by C<encode> will be shrunk-to-fit, |
232 | while all strings generated by C<decode> will also be shrunk-to-fit. |
235 | while all strings generated by C<decode> will also be shrunk-to-fit. |
233 | |
236 | |
234 | If C<$enable> is false, then the normal perl allocation algorithms are used. |
237 | If C<$enable> is false, then the normal perl allocation algorithms are used. |