Author mpaolini
Recipients christian.heimes, ezio.melotti, methane, miss-islington, mpaolini, ncoghlan, pablogsal, rhettinger, serhiy.storchaka, steve.dower
Date 2019-08-15.20:41:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565901677.03.0.333504513672.issue37587@roundup.psfhosted.org>
In-reply-to
Content
also worth noting escape sequences for non-ascii characters are slower, even when encoded length is the same.

python -m pyperf timeit -s 'import json;' -s  'c = "€"; s = json.dumps(c * (2**10 // len(json.dumps(c)) - 2))' 'json.loads(s)' -o nonascii2k.json

python -m pyperf timeit -s 'import json;' -s  'c = "a"; s = json.dumps(c * (2**10 // len(json.dumps(c)) - 2))' 'json.loads(s)' -o ascii2k.json

Mean +- std dev: [ascii2k] 2.59 us +- 0.04 us -> [nonascii2k] 9.98 us +- 0.12 us: 3.86x slower (+286%)
History
Date User Action Args
2019-08-15 20:41:17mpaolinisetrecipients: + mpaolini, rhettinger, ncoghlan, christian.heimes, ezio.melotti, methane, serhiy.storchaka, steve.dower, pablogsal, miss-islington
2019-08-15 20:41:17mpaolinisetmessageid: <1565901677.03.0.333504513672.issue37587@roundup.psfhosted.org>
2019-08-15 20:41:17mpaolinilinkissue37587 messages
2019-08-15 20:41:16mpaolinicreate