-
-
Save abunsen/1023137 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
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win';'i am a {0}er'.format(lol);" | |
1000000 loops, best of 3: 0.72 usec per loop | |
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; ''.join(['i am a ', lol]);" | |
1000000 loops, best of 3: 0.58 usec per loop | |
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; 'i am a %ser' % lol;" | |
1000000 loops, best of 3: 0.39 usec per loop | |
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; 'i am a '+ lol +'er'" | |
1000000 loops, best of 3: 0.26 usec per loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment