Skip to content

Instantly share code, notes, and snippets.

@rhizoome
Created June 2, 2016 12:27
Show Gist options
  • Select an option

  • Save rhizoome/2ca203c5089bde0140f1204ad0950a12 to your computer and use it in GitHub Desktop.

Select an option

Save rhizoome/2ca203c5089bde0140f1204ad0950a12 to your computer and use it in GitHub Desktop.
import timeit
# Why we need concs
for x in [10, 100, 1000, 10000]:
print(timeit.timeit(
"ll = len(l) // 2; a = l[:ll]; b = l[ll:]",
"l = [0] * %d" % x
))
# 0.31274792200019874
# 0.6819477400003962
# 4.02043846000015
# 37.608015921001424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment