Message181753
| Author |
pitrou |
| Recipients |
ezio.melotti, gvanrossum, pitrou, serhiy.storchaka |
| Date |
2013年02月09日.19:43:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1360439033.43.0.496471662015.issue17170@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Indeed the function call cost actually dominates:
$ ./python -m timeit -s "a = 'hundred'" "a.find('x')"
1000000 loops, best of 3: 0.206 usec per loop
$ ./python -m timeit -s "a = 'hundred'; f=a.find" "f('x')"
10000000 loops, best of 3: 0.176 usec per loop
$ ./python -m timeit -s "a = 'hundred'" "'x' in a"
10000000 loops, best of 3: 0.0431 usec per loop |
|