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/087527.html below:

[Python-Dev] speeding up PyObject_GetItem

[Python-Dev] speeding up PyObject_GetItem [Python-Dev] speeding up PyObject_GetItemCollin Winter collinw at gmail.com
Tue Mar 24 20:05:23 CET 2009
2009/3/24 Daniel Stutzbach <daniel at stutzbachenterprises.com>:
> On Tue, Mar 24, 2009 at 10:13 AM, Mark Dickinson <dickinsm at gmail.com> wrote:
>>
>> 2009/3/24 Daniel Stutzbach <daniel at stutzbachenterprises.com>:
>> > [...]
>> > 100 nanoseconds, py3k trunk:
>> > ceval -> PyObject_GetItem (object.c) -> list_subscript (listobject.c) ->
>> > PyNumber_AsSsize_t (object.c) -> PyLong_AsSsize_t (longobject.c)
>> > [more timings snipped]
>>
>> Does removing the PyLong_Check call in PyLong_AsSsize_t
>> make any noticeable difference to these timings?
>
> Making no other changes from the trunk, removing the PyLong_Check and NULL
> check from PyLong_AsSsize_t shaves off 4 nanoseconds (or around 4% since the
> trunk is around 100 nanoseconds).
>
> Here's what I'm testing with, by the way:
>
> ./python.exe Lib/timeit.py -r 10 -s 'x = list(range(10))' 'x[5]'

What difference does it make on real applications? Are you running any
macro-benchmarks against this?

Collin
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