Érdekesség:
def calc():
res = 0
for i in range(1, pow(10, 9)):
res += i
return res
Python3: 38s, Pypy3: 1.1s, Numba: 0.18s
Nehezebb feladat (iterátor):
def calc():
return sum(range(1, pow(10, 9)))
Python3: 10s, Pypy3: 1.1s, Numba: 10s (Warning: cannot determine Numba type of <class 'builtin_function_or_method'>)