A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-March/087488.html below:

[Python-Dev] speeding up PyObject_GetItem

[Python-Dev] speeding up PyObject_GetItemHrvoje Niksic hrvoje.niksic at avl.com
Tue Mar 24 10:30:46 CET 2009
Nick Coghlan wrote:
>> Many of the routines in abstract.c check their parameters for NULL, as a
>> sanity check, and throw a SystemError if NULL is detected.  I'm tempted
>> to suggest making these checks only when Py_DEBUG is defined, but I
>> suspect if you wanted it that way, you would have changed it already. ;)
>> 
>> Assuming you really want the NULL checks in production Python, there are
>> 5 checks for NULL even though there are only two parameters.  Seems like
>> overkill?
> 
> The main problem is that many of these methods are not only used
> internally, but are *also* part of the public C API made available to
> extension modules. We want misuse of the latter to trigger exceptions,
> not segfault the interpreter.

Agreed, and more importantly, I have yet to be convinced that those NULL 
checks introduce a measurable slowdown.  Daniel, have you tried 
measuring the performance difference with only the NULL checks removed?
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4