[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-31 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 768569325abc0a9cd5aae65c531889ec390847aa by Ken Jin in branch 'main': bpo-46407: Fix long_mod refleak (GH-31025) https://github.com/python/cpython/commit/768569325abc0a9cd5aae65c531889ec390847aa -- nosy: +lukasz.langa

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-30 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 6.0 -> 7.0 pull_requests: +29206 pull_request: https://github.com/python/cpython/pull/31025 ___ Python tracker ___

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-27 Thread Tim Peters
Tim Peters added the comment: I only merged the split-off PR that added new remainder-only functions. Still thinking about the `1 << n` and `2**n` one. -- assignee: -> tim.peters resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-27 Thread Tim Peters
Tim Peters added the comment: New changeset f10dafc430279b4e6cf5b981ae3d1d76e8f431ad by Crowthebird in branch 'main': bpo-46407: Optimizing some modulo operations (GH-30653) https://github.com/python/cpython/commit/f10dafc430279b4e6cf5b981ae3d1d76e8f431ad --

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-17 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- pull_requests: +28854 pull_request: https://github.com/python/cpython/pull/30653 ___ Python tracker ___

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-17 Thread theeshallnotknowethme
theeshallnotknowethme added the comment: Also how would it be implemented? in terms of a PyLongObject or just a uint64_t? -- ___ Python tracker ___

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-17 Thread theeshallnotknowethme
theeshallnotknowethme added the comment: > Another option to consider would be a table lookup of a pre-computed table of > [1 << i for i in range(64)]. Does it have a significantly better performance compared to not having a table lookup? -- ___

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: Another option to consider would be a table lookup of a pre-computed table of [1 << i for i in range(64)]. -- nosy: +Dennis Sweeney ___ Python tracker

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mark.dickinson, rhettinger, stutzbach, tim.peters ___ Python tracker ___ ___

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-16 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-16 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- keywords: +patch pull_requests: +28831 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30628 ___ Python tracker

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-16 Thread theeshallnotknowethme
theeshallnotknowethme added the comment: Note that `n` should not be over PY_SSIZE_T_MAX, else an error should occur. -- ___ Python tracker ___

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-16 Thread theeshallnotknowethme
New submission from theeshallnotknowethme : Optimize calculating powers of 2 for integers. Does not include optimizing modular exponentiation because benchmarking shows current version of modular exponentiation is faster. Also optimizes any call with the structure `l_divmod(a, b, NULL, )`.