Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14)

#23206: json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 2 months ago by songofacandy
Modified:
5 years, 2 months ago
Reviewers:
pitrou, berker.peksag
CC:
rhettinger, AntoinePitrou, ezio.melotti, arfrever.fta_gmail.com, inada.naoki, storchaka
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 4

Patch Set 3 #

Patch Set 4 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/json/encoder.py View 1 2 3 3 chunks +8 lines, -1 line 0 comments Download
Lib/test/test_json/test_encode_basestring_ascii.py View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
Lib/test/test_json/test_encode_basestring.py View 1 2 3 1 chunk +44 lines, -0 lines 4 comments Download
Modules/_json.c View 1 2 3 6 chunks +130 lines, -3 lines 2 comments Download

Messages

Total messages: 3
pitrou_free.fr
http://bugs.python.org/review/23206/diff/13569/Lib/test/test_json/test_encode_basestring.py File Lib/test/test_json/test_encode_basestring.py (right): http://bugs.python.org/review/23206/diff/13569/Lib/test/test_json/test_encode_basestring.py#newcode6 Lib/test/test_json/test_encode_basestring.py:6: # Copied from test_encode_basestring_ascii Can you put all tests ...
5 years, 2 months ago #1
inada.naoki
I've sent new patch. http://bugs.python.org/review/23206/diff/13569/Lib/test/test_json/test_encode_basestring.py File Lib/test/test_json/test_encode_basestring.py (right): http://bugs.python.org/review/23206/diff/13569/Lib/test/test_json/test_encode_basestring.py#newcode6 Lib/test/test_json/test_encode_basestring.py:6: # Copied from test_encode_basestring_ascii On ...
5 years, 2 months ago #2
berkerpeksag
5 years, 2 months ago #3
http://bugs.python.org/review/23206/diff/13594/Lib/test/test_json/test_encode...
File Lib/test/test_json/test_encode_basestring.py (right):

http://bugs.python.org/review/23206/diff/13594/Lib/test/test_json/test_encode...
Lib/test/test_json/test_encode_basestring.py:5: CASES = [
You could make this a class attribute.

http://bugs.python.org/review/23206/diff/13594/Lib/test/test_json/test_encode...
Lib/test/test_json/test_encode_basestring.py:25: for input_string, expect in
CASES:
You could use the new subTest feature here.

http://bugs.python.org/review/23206/diff/13594/Lib/test/test_json/test_encode...
Lib/test/test_json/test_encode_basestring.py:28: '{0!r} != {1!r} for
{2}({3!r})'.format(
Nitpick: '{0!r} != {1!r} for {2}({3!r})' -> '{!r} != {!r} for {}({!r})'

http://bugs.python.org/review/23206/diff/13594/Lib/test/test_json/test_encode...
Lib/test/test_json/test_encode_basestring.py:43: class
TestPyEncodeBasestring(TestEncodeBasestring, PyTest): pass
    class TestPyEncodeBasestring(TestEncodeBasestring, PyTest):
        pass

Also, please add two lines before TestCEncodeBasestring.

http://bugs.python.org/review/23206/diff/13594/Modules/_json.c
File Modules/_json.c (right):

http://bugs.python.org/review/23206/diff/13594/Modules/_json.c#newcode640
Modules/_json.c:640: else {
Is there a test case for this branch?

http://bugs.python.org/review/23206/diff/13594/Modules/_json.c#newcode642
Modules/_json.c:642: "first argument must be a string, not %.80s",
I'd replace %.80s with %R.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+