[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2022-01-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 243c31667cc15a9a338330ad9b2a29b1cd1c76ec by Raymond Hettinger in branch 'main': bpo-42161: Hoist the _PyLong_GetOne() call out of the inner loop. (GH-30656) https://github.com/python/cpython/commit/243c31667cc15a9a338330ad9b2a29b1cd1c76ec

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2022-01-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +28857 pull_request: https://github.com/python/cpython/pull/30656 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-05-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4115996342278de7c2a1b59ac348322e7a4e9072 by Miss Islington (bot) in branch '3.10': bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) (GH-26393)

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-05-26 Thread STINNER Victor
STINNER Victor added the comment: Raymond: "Can you fix all the other cases where this is used in inner-loop; otherwise, it is undoing everyone else's optimizations and fast paths." Done, thanks for the report. -- stage: patch review -> resolved status: open -> closed

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-05-26 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24986 pull_request: https://github.com/python/cpython/pull/26393 ___ Python tracker

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-05-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3e7ee02327db13e4337374597cdc4458ecb9e3ad by Victor Stinner in branch 'main': bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) https://github.com/python/cpython/commit/3e7ee02327db13e4337374597cdc4458ecb9e3ad --

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-05-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +24984 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26391 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't have a PR in-hand. I just ran across this when trying to explain 3.9 vs 3.10 timings and M-1 vs Intel timings. Ideally, all of these PRs should be reverted. Short of that, each change needs to be reviewed to see if it created extra work

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread STINNER Victor
STINNER Victor added the comment: Since it seems like you have already a ready patch to optimize the code, so go ahead and merge it. -- ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Thanks Raymond, I fixed the code. Can you fix all the other cases where this is used in inner-loop; otherwise, it is undoing everyone else's optimizations and fast paths. Also, it seems the that primary motivation for this is support subinterpreters.

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
STINNER Victor added the comment: Thanks Raymond, I fixed the code. I close the issue, I removed _PyLong_Zero and _PyLong_One variables. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 35b95aaf21534e4a8e3370dfd6f7482265316c9e by Victor Stinner in branch 'master': bpo-42161: Micro-optimize _collections._count_elements() (GH-23008) https://github.com/python/cpython/commit/35b95aaf21534e4a8e3370dfd6f7482265316c9e --

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset c310185c081110741fae914c06c7aaf673ad3d0d by Victor Stinner in branch 'master': bpo-42161: Remove private _PyLong_Zero and _PyLong_One (GH-23003) https://github.com/python/cpython/commit/c310185c081110741fae914c06c7aaf673ad3d0d --

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
STINNER Victor added the comment: > Why did you put _PyLong_GetOne() inside the loop for the fast path and > outside the loop for the slow path? Oh, I didn't notice that the first part was also a loop. I wrote PR 23008 to move the call out of the loop. I tried to avoid calling the function

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +21924 pull_request: https://github.com/python/cpython/pull/23008 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Why did you put _PyLong_GetOne() inside the loop for the fast path and outside the loop for the slow path? == diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +21918 pull_request: https://github.com/python/cpython/pull/23003 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 37834136d0afe51d274bfc79d8705514cbe73727 by Victor Stinner in branch 'master': bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (GH-22998) https://github.com/python/cpython/commit/37834136d0afe51d274bfc79d8705514cbe73727

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +21913 pull_request: https://github.com/python/cpython/pull/22998 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset c9bc290dd6e3994a4ead2a224178bcba86f0c0e4 by Victor Stinner in branch 'master': bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995) https://github.com/python/cpython/commit/c9bc290dd6e3994a4ead2a224178bcba86f0c0e4 --

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +21909 pull_request: https://github.com/python/cpython/pull/22995 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8e3b9f92835654943bb59d9658bb52e1b0f40a22 by Victor Stinner in branch 'master': bpo-42161: Add _PyLong_GetZero() and _PyLong_GetOne() (GH-22993) https://github.com/python/cpython/commit/8e3b9f92835654943bb59d9658bb52e1b0f40a22 --

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +21907 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22993 ___ Python tracker ___

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor
New submission from STINNER Victor : In bpo-38858, I made the small integer singletons per interpreter: commit 630c8df5cf126594f8c1c4579c1888ca80a29d59. _PyLong_Zero and _PyLong_One variables are still shared by all interpreters, whereas subinterpreters must not share Python objects: see