[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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/15d50d7ed8afd3ab26b00210b5b4feaaadd5af51


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 little helps.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 further changes in longobject.c, or some other mechanism?

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, all integers are "medium".

However, we make little effort to exploit that fact in the code for binary 
operations, which are very common operations on integers.

--
components: Interpreter Core
messages: 399832
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Integer operations are inefficient for "medium" integers.
type: performance

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com