summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-04-26 20:39:20 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-04-26 20:39:20 (GMT)
commit9e392e2412308c7923195f226510bb1f174be215 (patch)
tree234c290c12a4cba247e7fd044e0cbb0998180636 /Modules/timemodule.c
parent50422b403c4ebea87f7af840e5c5cf147155639e (diff)
downloadcpython-9e392e2412308c7923195f226510bb1f174be215.zip
cpython-9e392e2412308c7923195f226510bb1f174be215.tar.gz
cpython-9e392e2412308c7923195f226510bb1f174be215.tar.bz2
potentially useless optimization
The previous checkin (2.84) added a PyErr_Format call that made the cost of raising an AttributeError much more expensive. In general this doesn't matter, except that checks for __init__ and __del__ methods, where exceptions are caught and cleared in C, also got much more expensive. The fix is to split instance_getattr1 into two calls: instance_getattr2 checks the instance and the class for the attribute and returns it or returns NULL on error. It does not raise an exception. instance_getattr1 does rexec checks, then calls instance_getattr2. It raises an exception if instance_getattr2 returns NULL. PyInstance_New and instance_dealloc now call instance_getattr2 directly.
Diffstat (limited to 'Modules/timemodule.c')
0 files changed, 0 insertions, 0 deletions