Message215538
translate_script.py: microbenchmark for str.translate() with various length, charsets (ASCII, latin1, UCS2, UCS4) and percentage of replacement. Result:
---------------------------+----------+---------
Summary | original | writer
---------------------------+------+---------
replace none, length=10 | 5.65 us | 5.67 us
replace none, length=10**3 | 489 us | 486 us
replace none, length=10**6 | 487 ms | 484 ms
replace 10%, length=10 | 5.47 us | 5.48 us
replace 10%, length=10**3 | 455 us | 455 us
replace 10%, length=10**6 | 455 ms | 455 ms
replace 50%, length=10 | 4.71 us | 4.7 us
replace 50%, length=10**3 | 372 us | 374 us
replace 50%, length=10**6 | 371 ms | 373 ms
replace 90%, length=10 | 3.88 us | 3.93 us
replace 90%, length=10**3 | 293 us | 297 us
replace 90%, length=10**6 | 293 ms | 295 ms
replace all, length=10 | 3.58 us | 3.59 us
replace all, length=10**3 | 263 us | 262 us
replace all, length=10**6 | 262 ms | 261 ms
---------------------------+----------+---------
Total | 1.87 sec | 1.87 sec
---------------------------+----------+---------
It's exactly the same with translate_writer.patch. |
|
Date |
User |
Action |
Args |
2014-04-04 17:29:34 | vstinner | set | recipients:
+ vstinner, pitrou, ezio.melotti, serhiy.storchaka, josh.r |
2014-04-04 17:29:34 | vstinner | set | messageid: <1396632574.08.0.398448229694.issue21118@psf.upfronthosting.co.za> |
2014-04-04 17:29:34 | vstinner | link | issue21118 messages |
2014-04-04 17:29:33 | vstinner | create | |
|