Measure execution time with Python timeit
module.
Example: compare the sort time between sorting list and sorting dict.
Generate sample dict, sort it:
di = {i:random.randint(1,100) for i in range(0,10)}
sorted(ls, key=lambda pair: pair[1])
[(1, 10),
(7, 38),