[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-11 Thread Antoine Pitrou
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’:

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-11 Thread Antoine Pitrou
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

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-10 Thread INADA Naoki
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

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-10 Thread INADA Naoki
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

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-10 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23206 ___

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread Antoine Pitrou
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 ___ ___

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread INADA Naoki
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

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread INADA Naoki
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,

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread INADA Naoki
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

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread Serhiy Storchaka
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