[pypy-commit] pypy json-decoder-speedups: further speedups
fijal
noreply at buildbot.pypy.org
Wed Feb 8 21:04:08 CET 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: json-decoder-speedups
Changeset: r52255:afb4c5c2ffbd
Date: 2012-02-08 21:56 +0200
http://bitbucket.org/pypy/pypy/changeset/afb4c5c2ffbd/
Log: further speedups
diff --git a/lib-python/modified-2.7/json/decoder.py b/lib-python/modified-2.7/json/decoder.py
--- a/lib-python/modified-2.7/json/decoder.py
+++ b/lib-python/modified-2.7/json/decoder.py
@@ -110,14 +110,14 @@
raise ValueError(
errmsg("Unterminated string starting at", s, begin))
end = chunk.end()
- content, terminator = chunk.groups()
- del chunk
+ content = s[chunk.start(1):chunk.end(1)]
+ terminator = s[chunk.start(2):chunk.end(2)]
+ #content, terminator = chunk.groups()
# Content is contains zero or more unescaped string characters
if content:
if not isinstance(content, unicode):
content = unicode(content, encoding)
chunks.append(content)
- del content
# Terminator is the end of string, a literal control character,
# or a backslash denoting that an escape sequence follows
if terminator == '"':
@@ -166,6 +166,8 @@
char = unichr(uni)
end = next_end
# Append the unescaped character
+ del chunk
+ del content
chunks.append(char)
return u''.join(chunks), end
More information about the pypy-commit
mailing list