1 | initial version |
Using Cython can dramatically improve performance by converting the code to C and compiling it. For example,
%%cython
import random
def run(end):
uni = {}
for count in range(0, end):
i = random.randint(1, 303325737249669131)
if i in uni:
uni[i] += 1
else:
uni[i] = 1
return uni