[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: > I think that integer overflow in _Unpickler_Read() is possible. n is read > from file and can be arbitrary (up to PY_SSIZE_T_MAX). This likely cause > raising an exception later, but integer overflow itself causes undefined > behavior, and

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3d7b7aa89437 by Victor Stinner in branch 'default': Issue #27056: Fix _Unpickler_Read() to avoid integer overflow https://hg.python.org/cpython/rev/3d7b7aa89437 -- ___ Python tracker

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that integer overflow in _Unpickler_Read() is possible. n is read from file and can be arbitrary (up to PY_SSIZE_T_MAX). This likely cause raising an exception later, but integer overflow itself causes undefined behavior, and we should avoid it.

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "I forgot to note that the comment before _Unpickler_Read() becomes not correct, but you already addressed this in the second patch. unpickle_read-2.patch LGTM." Cool, pushed. "Few months ago I tried to optimize reading in pickle, but

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset f9b85b47f9c8 by Victor Stinner in branch 'default': Optimize pickle.load() and pickle.loads() https://hg.python.org/cpython/rev/f9b85b47f9c8 -- nosy: +python-dev ___ Python tracker

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I forgot to note that the comment before _Unpickler_Read() becomes not correct, but you already addressed this in the second patch. unpickle_read-2.patch LGTM. Few months ago I tried to optimize reading in pickle, but didn't see significant benefit. After

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: Updated patch 2 to address Serhiy's comments. -- Added file: http://bugs.python.org/file42914/unpickle_read-2.patch ___ Python tracker

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: +1. Similar optimization is used in marshal. Added comments on Rietveld. -- ___ Python tracker ___

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-19 Thread STINNER Victor
New submission from STINNER Victor: According to Linux perf, the unpickle_list benchmark (of the CPython benchmark suite) heavily depends on the performance of load() and _Unpickler_Read() functions. While running benchmarks with PGO+LTO compilation, I noticed a difference around 5% because