Message98639
| Author |
ferringb |
| Recipients |
ferringb |
| Date |
2010年02月01日.00:59:08 |
| SpamBayes Score |
1.5092693e-08 |
| Marked as misclassified |
No |
| Message-id |
<1264985952.93.0.779639488883.issue7826@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Bit like unittest, right now it's rather hard to extend 2to3 for caching support (and other outputs) w/out duplicating the main function.
Attached is a patch that allows the refactoring tool class to be passed in- at the very least, this patch is enough to remove some of the nastier monkey patching tricks I had to level to inline caching support into 2to3.
Actual caching patch will follow shortly; roughly what it does is track the md5 of the original source and use that as a lookup to the transformed version.
That caching support isn't useful to the majority of users, but for developers w/ buildslaves it's a very useful reduction in runtime- for example, for 6 buildslaves I run for pkgcore (a py2k source that we translate upon install to py3k if the target is py3k), if the cache is primed this is a reduction of 20s to 1.8s. Two minutes cpu time across the slaves brought down to ~11s.
As said, I understand it's a corner case, so getting the caching into 2to3 directly may not be possible.
This initial patch however makes it *way* easier to do inline the caching into 2to3 without having to copy/paste main (or do some heinous monkeypatching).
Patch is against svn trunk; doesn't apply cleanly to 3.1/2.6, but that's just a minor modification to make it so. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年02月01日 00:59:13 | ferringb | set | recipients:
+ ferringb |
| 2010年02月01日 00:59:12 | ferringb | set | messageid: <1264985952.93.0.779639488883.issue7826@psf.upfronthosting.co.za> |
| 2010年02月01日 00:59:09 | ferringb | link | issue7826 messages |
| 2010年02月01日 00:59:08 | ferringb | create |
|