This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
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
Date User Action Args
2013-02-09 19:43:53pitrousetrecipients: + pitrou, gvanrossum, ezio.melotti, serhiy.storchaka
2013-02-09 19:43:53pitrousetmessageid: <>
2013-02-09 19:43:53pitroulinkissue17170 messages
2013-02-09 19:43:53pitroucreate