[issue28126] Py_MEMCPY: Use memcpy on Windows?

2018-04-17 Thread Andro Nuxx
Andro Nuxx added the comment: Py_MEMCPY() has a special case for small blocks on Windows to work around an ancient performance issue in MSVC. Can we safely assume that recent MSVC properly optimize memcpy()? See #28055 /* Py_MEMCPY can be used instead of memcpy in cases

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +924 ___ Python tracker ___ ___

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Steve Dower
Steve Dower added the comment: > They might get a tiny bit faster on Windows, if they have used Py_MEMCPY() > for up to 16 bytes Even that's unlikely as the loop in the macro would have been unrolled in practically every case. This is about removing an unnecessary macro. Certainly no API

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Christian Heimes
Christian Heimes added the comment: My change doesn't break or change 3rd party application. They might get a tiny bit faster on Windows, if they have used Py_MEMCPY() for up to 16 bytes. That's it. -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread STINNER Victor
STINNER Victor added the comment: I don't think that it's very useful to discuss the status of the macro. Documenting the change doesn't harm ;-) -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The Py_MEMCPY name doesn't start by an underscore, and it is not inside the "#ifndef Py_LIMITED_API" block. But it is not documented either. I don't know what is the status of this macro. If this is a part of public API, this change should be documented in

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Christian Heimes
Christian Heimes added the comment: Isn't the C API section reserved for C API changes? I haven't changed the C API but rather optimized the core. -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Shouldn't the NEWS entity be in the C API section? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset bedce61ae0a0 by Christian Heimes in branch '3.6': Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy(). https://hg.python.org/cpython/rev/bedce61ae0a0 New changeset f5d32ed0f9c2 by Christian Heimes in branch

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Christian Heimes
Changes by Christian Heimes : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Christian Heimes
Christian Heimes added the comment: As I said, I'm going to keep Py_MEMCPY around but replace it everywhere else. /* Py_MEMCPY is kept for backwards compatibility, * see https://bugs.python.org/issue28126 */ #define Py_MEMCPY memcpy -- ___ Python

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread STINNER Victor
STINNER Victor added the comment: The macro looks public, you cannot remove it. Make it an alias to memcpy(), but explain that it's only kept for backward compatibility with a reference to this issue. -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Christian Heimes
Christian Heimes added the comment: Behold the power of Unix! :) $ find -name '*.[ch]' | xargs sed -i s/Py_MEMCPY/memcpy/g Victor, are you fine with the change? I'm going to keep Py_MEMCPY around. -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Steve Dower
Steve Dower added the comment: I'm okay with removing it completely, if you're willing to change that much code. (Most of my additions already uses memcpy or memcpy_s directly, since I wasn't even aware of this macro :) ) -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Christian Heimes
Christian Heimes added the comment: Perfect, thanks! Should we keep the Py_MEMCPY() macro for now and define it to memcpy()? Or should I get rid of it and just define it for b/w compatibility? -- ___ Python tracker

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Steve Dower
Steve Dower added the comment: Yes, memcpy (or preferably memcpy_s, which includes the size of the destination) are basically intrinsics that will inline short copies and call out to a range of implementations depending on alignment/overlap/etc. --

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Christian Heimes
New submission from Christian Heimes: Py_MEMCPY() has a special case for small blocks on Windows to work around an ancient performance issue in MSVC. Can we safely assume that recent MSVC properly optimize memcpy()? See #28055 /* Py_MEMCPY can be used instead of memcpy in cases where the