| 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
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.