This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# print common area of sorted [(a_i, b_i)] | |
a = [1, 4, 5, 9] | |
b = [3, 6, 7, 9] | |
lines = "0 1 2 3 4 5 6 7 8 9 10".split() | |
def f(i, no): | |
if i == len(a): | |
return | |
if a[i] > no: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[vagrant@debian-jessie]$ python -m timeit 'import string; import random; "".join([random.choice(string.digits) for _ in range(36)])' | |
100000 loops, best of 3: 15.3 usec per loop | |
python -m timeit 6.38s user 0.00s system 99% cpu 6.408 total | |
[vagrant@debian-jessie]$ python -m timeit 'import uuid; str(uuid.uuid4())' | |
100000 loops, best of 3: 18.2 usec per loop | |
python -m timeit 'import uuid; str(uuid.uuid4())' 6.13s user 1.54s system 98% cpu 7.763 total | |
[vagrant@debian-jessie]$ |