Showing content from http://mail.python.org/pipermail/python-dev/attachments/20090324/d24871af/attachment.htm below:
<div class="gmail_quote">On Tue, Mar 24, 2009 at 10:13 AM, Mark Dickinson <span dir="ltr"><<a href="mailto:dickinsm@gmail.com">dickinsm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/3/24 Daniel Stutzbach <<a href="mailto:daniel@stutzbachenterprises.com">daniel@stutzbachenterprises.com</a>>:<br>
> [...]<br>
<div class="im">> 100 nanoseconds, py3k trunk:<br>
> ceval -> PyObject_GetItem (object.c) -> list_subscript (listobject.c) -><br>
> PyNumber_AsSsize_t (object.c) -> PyLong_AsSsize_t (longobject.c)<br>
</div>> [more timings snipped]<br>
<br>
Does removing the PyLong_Check call in PyLong_AsSsize_t<br>
make any noticeable difference to these timings?<br>
</blockquote></div><br>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).<br><br>Here's what I'm testing with, by the way:<br>
<br>./python.exe Lib/timeit.py -r 10 -s 'x = list(range(10))' 'x[5]'<br><blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>
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