Antoine Pitrou added the comment:
I get the following compile error:
In file included from ./Include/Python.h:48:0,
from /home/antoine/cpython/default/Modules/_json.c:1:
/home/antoine/cpython/default/Modules/_json.c: In function ‘escape_unicode’:
Antoine Pitrou added the comment:
The patch was committed in b312b256931e. Thank you!
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23206
INADA Naoki added the comment:
I've updated patch to use PyUnicode_MAX_CHAR_VALUE().
--
Added file: http://bugs.python.org/file37669/json-fast-unicode-encode.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23206
INADA Naoki added the comment:
test_encode_basestring_ascii.py has duplicated test cases.
--
Added file: http://bugs.python.org/file37670/json-fast-unicode-encode.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23206
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23206
___
Antoine Pitrou added the comment:
Thank you for the patch! I posted a review.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23206
___
___
INADA Naoki added the comment:
Patch update.
Now C version does escaping same way to Python version.
--
Added file: http://bugs.python.org/file37656/json-fast-unicode-encode.patch
___
Python tracker rep...@bugs.python.org
New submission from INADA Naoki:
I prefer ensure_ascii=False because it's efficient.
But I notice it is very slower.
On Python 3.4.2:
In [3]: %timeit json.dumps([{'hello': 'world'}]*100)
1 loops, best of 3: 74.8 µs per loop
In [4]: %timeit json.dumps([{'hello': 'world'}]*100,
INADA Naoki added the comment:
I've copied test_encode_basestring_ascii.py and modify it for this patch.
--
Added file: http://bugs.python.org/file37654/test_encode_basestring.py
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +ezio.melotti, pitrou, rhettinger, serhiy.storchaka
stage: - patch review
type: - performance
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23206
10 matches
Mail list logo