Message282785
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. |
|
Date |
User |
Action |
Args |
2016-12-09 14:53:28 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka, xiang.zhang |
2016-12-09 14:53:28 | vstinner | set | messageid: <1481295208.95.0.470461654349.issue28921@psf.upfronthosting.co.za> |
2016-12-09 14:53:28 | vstinner | link | issue28921 messages |
2016-12-09 14:53:28 | vstinner | create | |
|