[issue47005] Improve performance of bytes_repeat

2022-03-13 Thread Pieter Eendebak


New submission from Pieter Eendebak :

The bytearray_repeat and bytearray_irepeat are inefficient for small arrays and 
a high number of repeats.
This can be improved by using the same approach is in the corresponding 
bytes_repeat method.

Microbenchmark:

python -m pyperf timeit "b=bytearray([1,2,])*100" 

Mean +- std dev: [base100] 479 ns +- 29 ns -> [patch100] 274 ns +- 18 ns: 1.75x 
faster

python -m pyperf timeit "b=bytearray([1,2,])*1000"

Mean +- std dev: [base1000] 2.58 us +- 0.18 us -> [patch1000] 399 ns +- 26 ns: 
6.46x faster

--
components: Interpreter Core
messages: 415077
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Improve performance of bytes_repeat
type: performance
versions: Python 3.11

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



[issue47070] Improve performance of array_inplace_repeat

2022-03-19 Thread Pieter Eendebak


New submission from Pieter Eendebak :

The array_inplace_repeat is inefficient for small arrays and a high number of 
repeats. This can be improved by using the same approach as in 
https://bugs.python.org/issue47005

--
components: Interpreter Core
messages: 415572
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Improve performance of array_inplace_repeat
type: performance
versions: Python 3.11

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



[issue47070] Improve performance of array_inplace_repeat

2022-03-19 Thread Pieter Eendebak


Change by Pieter Eendebak :


--
keywords: +patch
pull_requests: +30088
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31999

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



[issue47091] Improve performance of list and tuple repeat methods

2022-03-22 Thread Pieter Eendebak


New submission from Pieter Eendebak :

Approach is similar to https://github.com/python/cpython/pull/31856 and 
https://github.com/python/cpython/pull/31999

--
components: Interpreter Core
messages: 415762
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Improve performance of list and tuple repeat methods
versions: Python 3.11

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



[issue47091] Improve performance of list and tuple repeat methods

2022-03-22 Thread Pieter Eendebak


Change by Pieter Eendebak :


--
keywords: +patch
pull_requests: +30135
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32045

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



[issue47091] Improve performance of list and tuple repeat methods

2022-03-22 Thread Pieter Eendebak


Pieter Eendebak  added the comment:

The special case of a repeat with n=1 does not use memcpy. An implementation 
with it showed no performance improvement.

--

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



[issue47110] Refactor bytearray strip methods

2022-03-24 Thread Pieter Eendebak


New submission from Pieter Eendebak :

The bytearray strip, lstrip and rstrip methods contain a lot of duplicated code.

--
components: Interpreter Core
messages: 415939
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Refactor bytearray strip methods
versions: Python 3.11

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



[issue47110] Refactor bytearray strip methods

2022-03-24 Thread Pieter Eendebak


Change by Pieter Eendebak :


--
keywords: +patch
pull_requests: +30180
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32096

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



[issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c

2022-03-25 Thread Pieter Eendebak


New submission from Pieter Eendebak :

In https://github.com/python/cpython/pull/31867 the method 
_PyLong_FromUnsignedChar was introduced for faster conversion of byteaarray 
elements.

We can use the method in more places

--
components: Interpreter Core
messages: 415991
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Use _PyLong_FromUnsignedChar in bytearrayobject.c
versions: Python 3.11

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



[issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c

2022-03-25 Thread Pieter Eendebak


Change by Pieter Eendebak :


--
keywords: +patch
pull_requests: +30187
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32110

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



[issue47251] Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE

2022-04-07 Thread Pieter Eendebak


New submission from Pieter Eendebak :

The implementations of BINARY_SUBSCR_LIST_INT and BINARY_SUBSCR_TUPLE_INT are 
almost identical. They can be merged, so there is one opcode less and the code 
is shared.

--
components: Interpreter Core
messages: 416937
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE
versions: Python 3.11

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



[issue47251] Merge BINARY_SUBSCR_LIST_INT with BINARY_SUBSCR_LIST_TUPLE

2022-04-07 Thread Pieter Eendebak


Change by Pieter Eendebak :


--
keywords: +patch
pull_requests: +30429
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32404

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