diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-05-29 18:03:22 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-05-29 18:03:22 +0930 |
commit | 3d1c5e19f45cf484774926ba6e2555d1c8e4c39b (patch) | |
tree | f6cd7cc888ec643d025a37810fe7f15cc91d7381 /README | |
parent | c0b473a8e974407dc308ce0fd0058136b9faa90c (diff) | |
download | lua-cjson-3d1c5e19f45cf484774926ba6e2555d1c8e4c39b.tar.gz lua-cjson-3d1c5e19f45cf484774926ba6e2555d1c8e4c39b.tar.bz2 lua-cjson-3d1c5e19f45cf484774926ba6e2555d1c8e4c39b.zip |
Add support for runtime number precision config
Add cjson.encode_number_precision(). Reducing the number precision from
14 to 3 can increase performance up to 50% with number heavy
conversions.
Diffstat (limited to 'README')
-rw-r--r-- | README | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -204,6 +204,19 @@ the application. Eg: | |||
204 | a = {}; b = { a }; a[1] = b | 204 | a = {}; b = { a }; a[1] = b |
205 | 205 | ||
206 | 206 | ||
207 | Number precision | ||
208 | ---------------- | ||
209 | |||
210 | precision = cjson.encode_number_precision([precision]) | ||
211 | -- "precision" must be between 1 and 14 (inclusive) | ||
212 | |||
213 | By default CJSON will use up to 14 digits for precision when | ||
214 | converting a number to text. | ||
215 | |||
216 | Reducing number precision to 3 can improve performance of number | ||
217 | heavy conversions by up to 50%. | ||
218 | |||
219 | |||
207 | Persistent encoding buffer | 220 | Persistent encoding buffer |
208 | ------------------------- | 221 | ------------------------- |
209 | 222 | ||