Differences between revisions 3 and 4
Revision 3 as of 2006-05-24 15:12:08
Size: 345
Editor: RichardJones
Comment:
Revision 4 as of 2006-05-26 23:34:43
Size: 915
Editor: TimPeters
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:

'''Out-thinking exceptions'''

CPython spends considerable time moving exception info around among thread states, frame objects, and the `sys` module. This code is complicated and under-documented. Patch SF:1145039 took a stab at reverse-engineering a weak invariant, and exploited it for a bit of speed. That worked fine so far as it went (and a variant was checked in), but it's likely more remains to be gotten. Alas, the `tim-exc_sanity` branch set up to try that consumed a lot of time fighting mysteries, and looks like it's more trouble than it's worth.

Things that we tried but decided were not good ideas.

List pre-allocation

Adding the ability to pre-allocate builtin list storage. At best we can speed up appends by about 7-8% for lists of 50-100 elements. For the large part the benefit is 0-2%. For lists under 20 elements, peformance is actually reduced when pre-allocating.

Out-thinking exceptions

CPython spends considerable time moving exception info around among thread states, frame objects, and the sys module. This code is complicated and under-documented. Patch 1145039 took a stab at reverse-engineering a weak invariant, and exploited it for a bit of speed. That worked fine so far as it went (and a variant was checked in), but it's likely more remains to be gotten. Alas, the tim-exc_sanity branch set up to try that consumed a lot of time fighting mysteries, and looks like it's more trouble than it's worth.

NeedForSpeed/Failures (last edited 2008-11-15 14:01:24 by localhost)

Unable to edit the page? See the FrontPage for instructions.