Bug report
List repeating can be optimized a bit by using the same algorithm/method as _PyBytes_Repeat:
python_original -m timeit -s "l = [*range(100)]" "l * 100"
5000 loops, best of 5: 31.9 usec per loop
python_modified -m timeit -s "l = [*range(100)]" "l * 100"
5000 loops, best of 5: 25.9 usec per loop
Your environment
- CPython versions tested on: 3.11.0a7+
- Operating system and architecture: Windows 10 64-bit
Bug report
List repeating can be optimized a bit by using the same algorithm/method as
_PyBytes_Repeat:Your environment