[Python-Dev] optimization required: .format() is much slower than % (original) (raw)
skip at pobox.com skip at pobox.com
Tue May 27 13:35:10 CEST 2008
- Previous message: [Python-Dev] optimization required: .format() is much slower than %
- Next message: [Python-Dev] optimization required: .format() is much slower than %
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick> $ ./python -m timeit "'' % ()"
Nick> 1000000 loops, best of 3: 0.389 usec per loop
vs.
Nick> $ ./python -m timeit "'%s' % 'nothing'"
Nick> 10000000 loops, best of 3: 0.0736 usec per loop
I think you need to use a tuple for the second case to make it comparable to the first.
Skip
- Previous message: [Python-Dev] optimization required: .format() is much slower than %
- Next message: [Python-Dev] optimization required: .format() is much slower than %
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]