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 vstinner
Recipients serhiy.storchaka, vstinner, xiang.zhang
Date 2016-12-09.14:53:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481295208.95.0.470461654349.issue28921@psf.upfronthosting.co.za>
In-reply-to
Content
Hum, Serhiy is better than me to review such hardcore C code :-) I let him review the patch ;-)

> short one, a little regression

In stringlib, the usual solution is to use a threshold: use a dummy loop for less than N bytes, otherwise use the ultra-optimized loop. Serhiy event implemented a "dynamic" threshold in some functions, when too many false positive are found. I don't recall where.

"And since str.replace may also go through the code path involving count, it's somewhat affected: (...) 1.07x faster"

I'm not really excited by optimizing str.count, since I don't think that this function is commonly used. But if str.replace is made faster, I'm interested :-)

I understand that count() is only used when the old and new patterns of str.replace() have a different length.
History
Date User Action Args
2016-12-09 14:53:28vstinnersetrecipients: + vstinner, serhiy.storchaka, xiang.zhang
2016-12-09 14:53:28vstinnersetmessageid: <1481295208.95.0.470461654349.issue28921@psf.upfronthosting.co.za>
2016-12-09 14:53:28vstinnerlinkissue28921 messages
2016-12-09 14:53:28vstinnercreate