[Patches] Patch: AttributeError and NameError: second attempt.
Nick Mathewson
nickm@MIT.EDU
Fri, 26 May 2000 09:16:19 -0400
Not that it matters any more, but I thought I'd answer this question.
The reasoning is kind of neat.
"M.-A. Lemburg" <mal@lemburg.com> wrote:
[...]
>>
>> modified python: 22.790u 0.030s
>
>You mean CVS Python + your patch ? If yes, how can there be
>a speedup of this amount ?
>
>> cvs python, unmodified: 32.920u 0.000s
>> python 1.6a2: 39.850u 0.060s
>> python 1.5.2: 33.380u 0.020s
Because we're only testing the time it takes to generate and throw the
exception. When you throw an AttributeError on an Object now, you
need to generate a new string containing the Object's type and the
missing attribute. With my patch, even _this_ work was postponed until
you printed the exception.
--
Nick