Created
June 13, 2011 16:38
-
-
Save igorgue/1023132 to your computer and use it in GitHub Desktop.
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
☁ ~ python -mtimeit -c "lol = 'win'; ''.join(['i am a ', lol])" | |
1000000 loops, best of 3: 0.466 usec per loop | |
☁ ~ python -mtimeit -c "lol = 'win'; 'i am a %s' % lol" | |
1000000 loops, best of 3: 0.309 usec per loop | |
☁ ~ python -mtimeit -c "lol = 'win'; 'i am a {0}'.format(lol)" | |
1000000 loops, best of 3: 0.541 usec per loop | |
☁ ~ python -mtimeit -c "lol = 'win'; 'i am a ' + lol" | |
10000000 loops, best of 3: 0.21 usec per loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment