Open
Description
Code to reproduce the problem:
import timeit
# Default implementation:
# 0.0279839634584
print(
timeit.timeit(
'[round(0.5 * n) for n in range(100)]',
number=1000
)
)
# python-future's implementation:
# 2.35042388427
print(
timeit.timeit(
'[round(0.5 * n) for n in range(100)]',
setup="from builtins import round",
number=1000
)
)
100 times performance reduction comparing to default implementation is a serious thing.
It should be at least documented.
Tested with:
Python 2.7.13 x64
future 0.16.0
Windows 10 x64