2 ms·
Python is already so slow that it's comparable to normal iteration. But here's an example: timeit('next(x)', 'x = iter(range(1<<30))', number=1<<22) # 0.22
by mehrdadn 8y ago
Python is already so slow that it's comparable to normal iteration. But here's an example:
timeit('next(x)', 'x = iter(range(1<<30))', number=1<<22) # 0.22
timeit('''try: raise StopIteration()
except StopIteration: pass''', number=1<<22) # 0.78
- dijksterhuis 8y agoI pray for the day that Tensorflow has an official rust (or scala) api.