[issue44946] Integer operations are inefficient for "medium" integers.

2021-12-10 Thread Xinhang Xu
Change by Xinhang Xu : -- nosy: +xuxinhang nosy_count: 3.0 -> 4.0 pull_requests: +28270 pull_request: https://github.com/python/cpython/pull/30044 ___ Python tracker ___ __

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-26 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-25 Thread Mark Shannon
Mark Shannon added the comment: New changeset 15d50d7ed8afd3ab26b00210b5b4feaaadd5af51 by Mark Shannon in branch 'main': bpo-44946: Streamline operators and creation of ints for common case of single 'digit'. (GH-27832) https://github.com/python/cpython/commit/15d50d7ed8afd3ab26b00210b5b4fea

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-19 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +26296 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27832 ___ Python tracker ___ ___

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-18 Thread Mark Shannon
Mark Shannon added the comment: Just changes to longobject.c. There are still various minor inefficiencies in testing to see whether an int is a medium value, and then throwing away size information before creating result objects. I'm not expecting this to make much difference, but every li

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-18 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-18 Thread Mark Dickinson
Mark Dickinson added the comment: See also #21955, #10044, and https://github.com/python/cpython/blob/3240bc62f4e0afa09964f3afc845697f0a0806b9/Python/ceval.c#L1986-L1991 -- ___ Python tracker __

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-18 Thread Mark Dickinson
Mark Dickinson added the comment: We already special-case medium integers in the Objects/longobject.c code, in various places. For example for addition, here: https://github.com/python/cpython/blob/3240bc62f4e0afa09964f3afc845697f0a0806b9/Objects/longobject.c#L3070-L3072 Are you proposing fu

[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-18 Thread Mark Shannon
New submission from Mark Shannon : "Medium" integers are those with a single internal digit or zero. Medium integers are integers in the range -2**30 to +2**30 on 64 bit machines. "Small" integers, -5 to 256 are cached, but are represented as medium integers internally. To a good approximation