[issue28272] a redundant check in maybe_small_long

2017-03-03 Thread Mark Dickinson
Mark Dickinson added the comment: Without a demonstrable performance improvement, I'm opposed to making this change. Closing. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue28272] a redundant check in maybe_small_long

2017-03-03 Thread STINNER Victor
STINNER Victor added the comment: > So, should I open a pull request? I consider that Mark Dickinson is the maintained of longobject.c, so please for his feedback before going further. It seems like Mark consider that the change is worthless and bad for maintainability/sustainability. ---

[issue28272] a redundant check in maybe_small_long

2017-03-02 Thread Oren Milman
Oren Milman added the comment: So, should I open a pull request? (as some time had passed, I would also run again the tests, etc.) -- ___ Python tracker ___ _

[issue28272] a redundant check in maybe_small_long

2017-03-02 Thread STINNER Victor
STINNER Victor added the comment: > Try to bench list(range(256)). It should create small ints in tight loop. This expression doesn't call maybe_small_long(). -- ___ Python tracker

[issue28272] a redundant check in maybe_small_long

2017-03-02 Thread STINNER Victor
STINNER Victor added the comment: issue28272_ver1.diff LGTM. Mark Dickinson: "The extra check in maybe_small_long does have a value in (...) safety with respect to future maintenance," "assert(v != NULL);" has the same purpose. I think that it's ok to require that maybe_small_long() isn't cal

[issue28272] a redundant check in maybe_small_long

2017-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Try to bench list(range(256)). It should create small ints in tight loop. -- nosy: +serhiy.storchaka ___ Python tracker ___ __

[issue28272] a redundant check in maybe_small_long

2017-03-01 Thread Oren Milman
Oren Milman added the comment: ping (just to close the issue, I think) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue28272] a redundant check in maybe_small_long

2016-09-26 Thread Oren Milman
Oren Milman added the comment: my build (release): Python 3.7.0a0 (default:da2c96cf2ce6, Sep 26 2016, 13:08:47) [MSC v.1900 32 bit (Intel)] on win32 ISTM we can close this issue. -- ___ Python tracker ___

[issue28272] a redundant check in maybe_small_long

2016-09-26 Thread Antti Haapala
Antti Haapala added the comment: Totally inlined when built with GCC, release mode, there is no trace of the maybe_small_long symbol, I couldn't even really decipher where it was being done in the disassembly of longobject.c. Was this the Windows release build? -- nosy: +ztane ___

[issue28272] a redundant check in maybe_small_long

2016-09-26 Thread Oren Milman
Oren Milman added the comment: I looked at the assembly, and saw maybe_small_long is not inlined, but I agree that other compilers (or future compilers) might introduce some optimization that would elide the check. Also, as expected (thanks to branch prediction, I guess), a little microbenchm

[issue28272] a redundant check in maybe_small_long

2016-09-26 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the patch. I'm a bit reluctant to make changes like this unless there's a measurable performance benefit. The extra check in maybe_small_long does have a value in terms of readability and safety with respect to future maintenance, and I'd expect a c

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch Added file: http://bugs.python.org/file44819/issue28272_ver1.diff ___ Python tracker ___

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file44818/CPythonTestOutput.txt ___ Python tracker ___ ___ Python-bugs-list mailin

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file44817/patchedCPythonTestOutput_ver1.txt ___ Python tracker ___ ___ Python-bugs

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
Changes by Oren Milman : Removed file: http://bugs.python.org/file44815/CPythonTestOutput.txt ___ Python tracker ___ ___ Python-bugs-list mail

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
Changes by Oren Milman : Removed file: http://bugs.python.org/file44816/patchedCPythonTestOutput_ver1.txt ___ Python tracker ___ ___ Python-bu

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file44816/patchedCPythonTestOutput_ver1.txt ___ Python tracker ___ ___ Python-bugs

[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman
New submission from Oren Milman: current state In Objects/longobject.c, the function maybe_small_long first checks whether v (the received PyLongObject pointer) is not NULL. However, currently in every call to maybe_small_long, it is already guaranteed that v is not N