Message339617
This patch makes it slow for small iterators:
Perf program:
import perf
runner = perf.Runner()
runner.timeit("list_comp",
stmt="[x for x in range(10)]",
setup="")
Current master:
❯ ./python.exe ../check.py
.....................
list_comp: Mean +- std dev: 3.97 us +- 0.15 us
PR 12718:
❯ ./python.exe ../check.py
.....................
list_comp: Mean +- std dev: 4.57 us +- 0.17 us
The overhead is very likely due to calling __length_hint__ |
|
Date |
User |
Action |
Args |
2019-04-08 11:34:39 | pablogsal | set | recipients:
+ pablogsal, ronaldoussoren, ncoghlan, methane, serhiy.storchaka, Aaron Hall, anthony shaw |
2019-04-08 11:34:39 | pablogsal | set | messageid: <1554723279.24.0.450551464349.issue36551@roundup.psfhosted.org> |
2019-04-08 11:34:39 | pablogsal | link | issue36551 messages |
2019-04-08 11:34:39 | pablogsal | create | |
|