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