Created
September 13, 2012 15:53
-
-
Save jefftriplett/3715280 to your computer and use it in GitHub Desktop.
Perfect example of why my boss is an asshole. An optimizingly correct and performance tuned asshole.
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
| # example from: http://stackoverflow.com/questions/68630/are-tuples-more-efficient-than-lists-in-python | |
| $ python -m timeit "x=(1,2,3,4,5,6,7,8)" | |
| 10000000 loops, best of 3: 0.0571 usec per loop | |
| $ python -m timeit "x=[1,2,3,4,5,6,7,8]" | |
| 1000000 loops, best of 3: 0.254 usec per loop | |
| $ python -m timeit -s "x=(1,2,3,4,5,6,7,8)" "y=x[3]" | |
| 10000000 loops, best of 3: 0.0758 usec per loop | |
| $ python -m timeit -s "x=[1,2,3,4,5,6,7,8]" "y=x[3]" | |
| 10000000 loops, best of 3: 0.097 usec per loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment