[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-11-08 Thread STINNER Victor
STINNER Victor added the comment: greenlet now uses PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() rather than accessing directly use_tracing: https://github.com/python-greenlet/greenlet/commit/9b49da5c7e4808bd61b992e40f5b5243bfa9be6f On Python 3.10, it implements these

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-21 Thread STINNER Victor
STINNER Victor added the comment: I created https://github.com/python/cpython/pull/29121 to add PyThreadState_SetProfile() and PyThreadState_SetTrace() functions. -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset 034f607906de6e375cc9a98cc3b09f6d56f8be10 by Victor Stinner in branch 'main': bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032) https://github.com/python/cpython/commit/034f607906de6e375cc9a98cc3b09f6d56f8be10 --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27304 pull_request: https://github.com/python/cpython/pull/29032 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-18 Thread STINNER Victor
STINNER Victor added the comment: > * Cython: https://github.com/cython/cython/pull/4411 Merged: * 0.29.x: https://github.com/cython/cython/commit/cbddad23e30ea6d31e0178a4c623f1f6d75452c3 * master: https://github.com/cython/cython/commit/4df1103bd30143ce022b07f98a2f62678d417e92 --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-15 Thread STINNER Victor
STINNER Victor added the comment: PyThreadState.cframe.use_tracing format changed again: set value set to 0 or 255. https://github.com/python/cpython/commit/bd627eb7ed08a891dd1356756feb1ce2600358e4 -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-15 Thread STINNER Victor
STINNER Victor added the comment: > bpo-43760: Add PyThreadState_EnterTracing() (GH-28542) I created changes to use it: * pythoncapi_compat: https://github.com/pythoncapi/pythoncapi_compat/commit/10fde24739cab4547e9c27c31c8804a25e23e8a0 * Cython: https://github.com/cython/cython/pull/4411 *

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-15 Thread STINNER Victor
STINNER Victor added the comment: New changeset 547d26aa08aa5e4ec6e4f8a5587b30b39064a5ba by Victor Stinner in branch 'main': bpo-43760: Add PyThreadState_EnterTracing() (GH-28542) https://github.com/python/cpython/commit/547d26aa08aa5e4ec6e4f8a5587b30b39064a5ba --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-05 Thread Mark Shannon
Mark Shannon added the comment: New changeset bd627eb7ed08a891dd1356756feb1ce2600358e4 by Mark Shannon in branch 'main': bpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. (GH-28723)

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 78184fa6b0e6129203673e425718e08f5edb6e2e by Pablo Galindo (Miss Islington (bot)) in branch '3.10': bpo-43760: Document PyThreadState.use_tracing removal (GH-28527) (GH-28529)

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-04 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +27070 pull_request: https://github.com/python/cpython/pull/28723 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-24 Thread Guido van Rossum
Guido van Rossum added the comment: Ah, I think the docs need to be clarified a bit. Here's what I was missing: The key thing to know here is that there are *three* state variables; `c_tracefunc`, `c_profilefunc` (on the thread state), and `use_tracing` (on the C frame). Normally

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-24 Thread STINNER Victor
STINNER Victor added the comment: Analysis use use_tracing usage in 3rd part code. I see two main ways to add C API functions covering these use cases: * Provide high-level functions like "call a trace function" (disable tracing, call trace function, reenable tracing, increment/decrement

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-24 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +26926 pull_request: https://github.com/python/cpython/pull/28542 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-23 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 55576893b31452ba739e01189424cd62cf11ed20 by Miss Islington (bot) in branch '3.10': bpo-43760: Document PyThreadState.use_tracing removal (GH-28527) (GH-28529) https://github.com/python/cpython/commit/55576893b31452ba739e01189424cd62cf11ed20

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-23 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +26919 pull_request: https://github.com/python/cpython/pull/28529 ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset f4ccb79d52ee726d58bbb038ea98b4deec52001d by Victor Stinner in branch 'main': bpo-43760: Document PyThreadState.use_tracing removal (GH-28527) https://github.com/python/cpython/commit/f4ccb79d52ee726d58bbb038ea98b4deec52001d --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-23 Thread STINNER Victor
STINNER Victor added the comment: I created PR 28527 to document PyThreadState.use_tracing removal and explain how to port existing code to Python 3.10. -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +26918 pull_request: https://github.com/python/cpython/pull/28527 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Also, I checked the DWARF tree of all existing wheels for 3.10 on PyPI (there aren't many) and none had anything that uses the size of the struct. -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I'll just note that a change in struct size does technically break ABI, since > *arrays* of PyThreadState will break. Not that matters now because we are not proceeding but just to clarify why I deemed this acceptable: arrays of PyThreadState is

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Petr Viktorin
Petr Viktorin added the comment: > The ABI is not broken, the only thing that this PR change is the size of the > struct. All the offsets to the members are the same and therefore will be > valid in any compiled code. I'll just note that a change in struct size does technically break ABI,

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I discussed this particular instance with the Steering Council and the conclusion was that this field (use_tracing) is considered an implementation detail and therefore its removal it's justified so we won't be restoring it. I'm therefore closing

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I'm removing the release blocker as per above, feel free to close of there is nothing else to discuss or act on here. -- priority: release blocker -> ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Also, I personally thing there is absolutely no guarantee that Cython code generated for 3.9 should work for 3.10 and the thread state is a private structure that has undocumented fields and is not part of the stable API nor the limited API so,

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Also, just to clarify, I also opened PR 28498 to discuss the possibility of going ahead, I still don't want to move on without consensus. -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: >From PR 28498: @vstinner @ambv The ABI is not broken, the only thing that this PR change is the size of the struct. All the offsets to the members are the same and therefore will be valid in any compiled code. Any compiled wheels will still work.

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +26893 pull_request: https://github.com/python/cpython/pull/28498 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Miro Hrončok
Miro Hrončok added the comment: > It would mean that extensions compiled against the release candidates may not > be binary compatible with the final release If that's true, I definitively argue not to do that. We've told everybody it won't happen. --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread John Ehresman
John Ehresman added the comment: Is adding the field back an option at this point? It would mean that extensions compiled against the release candidates may not be binary compatible with the final release My take is that use_tracing is an implementation and version dependent field, and

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: > The code in the examples given above are using `tstate->use_tracing` assuming > that its meaning is to determine whether tracing is turned on or not. No, actually not. It is using the field in the same way as CPython, simply because most of this code was

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Xtrem532
Change by Xtrem532 : -- nosy: +Xtrem532 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +26872 pull_request: https://github.com/python/cpython/pull/28474 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Mark Shannon
Mark Shannon added the comment: IMO those failures are bugs in the projects listed not in CPython. Relying on the exact meaning, or even the existence of an undocumented field of a C struct is not, nor ever has been, safe. The user of the field is assuming a meaning that is not known to the

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread STINNER Victor
STINNER Victor added the comment: > A Cython issue report: https://github.com/cython/cython/issues/4153 Cython 0.29.24 released at July 13, 2021 with a fix (2 commits): * https://github.com/cython/cython/commit/be3b178296975b976107f41a6383291701e0297f *

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-19 Thread Miro Hrončok
Miro Hrončok added the comment: Also Numba is broken: https://bugzilla.redhat.com/show_bug.cgi?id=2005686 -- ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-19 Thread STINNER Victor
STINNER Victor added the comment: The commit 28d28e053db6b69d91c2dfd579207cd8ccbc39e7 caused a performance regression on Windows which is currently blocking the Python 3.10.0 final release: bpo-45116. Moroever, this issue introduced a incompatible C API change which is not documented in

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-14 Thread Stefan Behnel
Change by Stefan Behnel : -- Removed message: https://bugs.python.org/msg393667 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-14 Thread Stefan Behnel
Stefan Behnel added the comment: Should we allow empty CFrame entries (with a NULL Frame pointer) that only use their "use_tracing" flag? That would make it easy for code to append and remove such an entry in order to temporarily disable tracing. --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-14 Thread Stefan Behnel
Stefan Behnel added the comment: I just noticed that new C-API functions are probably useless for Cython since I think it will have to maintain the CFrame stack, so not to enable "use_tracing" for the (Python) caller but the current (Cython) function. This then means that we own The current

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-11 Thread Stefan Behnel
Stefan Behnel added the comment: For the same reason that motivated this ticket, I think the functions should be inline functions. They should also take the current thread-state as argument, because that's probably known on the caller side already. I guess a macro would be fine, too. :)

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-11 Thread Miro Hrončok
Miro Hrončok added the comment: A Cython issue report: https://github.com/cython/cython/issues/4153 -- ___ Python tracker ___ ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for Victor's suggestions. It provides a reasonable way forward without locking in eval-loop implementation details that weren't intended to be public and frozen in time. -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-10 Thread STINNER Victor
Change by STINNER Victor : -- components: +C API, Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-10 Thread STINNER Victor
Change by STINNER Victor : -- title: The DISPATCH() macro is not as efficient as it could be. -> The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) versions: +Python 3.10 ___ Python tracker