[issue30224] remove outdated checks in struct

2017-05-14 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Py

[issue30224] remove outdated checks in struct

2017-05-14 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset 96f502856796f9310fed7161dc540201a4afc1ee by Xiang Zhang in branch 'master': bpo-30224: remove outdated checks in struct (#1374) https://github.com/python/cpython/commit/96f502856796f9310fed7161dc540201a4afc1ee -- __

[issue30224] remove outdated checks in struct

2017-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your patch LGTM. Current code in _struct.c is ugly. I just wonder if it is worth to optimize PyLong_FromLongLong and PyLong_FromUnsignedLongLong if they are slower than PyLong_FromLong and PyLong_FromUnsignedLong. --

[issue30224] remove outdated checks in struct

2017-05-02 Thread Xiang Zhang
Xiang Zhang added the comment: The test on my box is reverse and stable, python3 is unpatched and python is patched. Anyway, it can't be called significant. ./python3 -m perf timeit --compare-to /home/angwer/repos/cpython/python -s 'import struct; u = struct.Struct("10Q").unpack; b=b"abc

[issue30224] remove outdated checks in struct

2017-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I see a tiny 3% regression. $ ./python -m timeit -s 'import struct; u = struct.Struct("10Q").unpack; b = b"abcd\0\0\0\0"*10' 'u(b)' Unpatched: 50 loops, best of 5: 9.34 msec per loop Patched:50 loops, best of 5: 9.66 msec per loop $ ./python -m

[issue30224] remove outdated checks in struct

2017-05-02 Thread Xiang Zhang
Xiang Zhang added the comment: There seems no significant regression in performance. A microbenchmark against nu_longlong: ./python3 -m perf timeit --duplicate=1000 --compare-to /home/angwer/repos/cpython/python -s 'import struct; p = struct.Struct("@L")' 'p.unpack(b"d\x00\x00\x00\x00\x00\x00

[issue30224] remove outdated checks in struct

2017-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please run microbenchmarks for affected code to be sure that changes don't hit performance (if for example PyLong_FromLongLong is significantly slower than PyLong_FromLong)? -- nosy: +serhiy.storchaka __

[issue30224] remove outdated checks in struct

2017-05-02 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +1482 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue30224] remove outdated checks in struct

2017-05-02 Thread Xiang Zhang
New submission from Xiang Zhang: Reading struct's code I find some checks seem outdated. They seemly exists because there are two kinds of integer in 2.x. I wrote a patch to remove them but maybe they exist for other reasons I don't see. Sorry if I misunderstand them. :-( -- component