]> granicus.if.org Git - python/commit
bpo-32492: 1.6x speed up in namedtuple attribute access using C fast-path (#10495)
authorPablo Galindo <Pablogsal@gmail.com>
Sun, 30 Dec 2018 09:24:03 +0000 (09:24 +0000)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Sun, 30 Dec 2018 09:24:03 +0000 (01:24 -0800)
commit3f5fc70c6213008243e7d605f7d8a2d8f94cf919
tree44c396f3a052803c4725eec2e6ccb1ab32529c8f
parentb0a6196ffd58ff91462191f426706897dc920eee
bpo-32492: 1.6x speed up in namedtuple attribute access using C fast-path (#10495)

* bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path

* Add News entry

* fixup! bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path

* Check for tuple in the __get__ of the new descriptor and don't cache the descriptor itself

* Don't inherit from property. Implement GC methods to handle __doc__

* Add a test for the docstring substitution in descriptors

* Update NEWS entry to reflect time against 3.7 branch

* Simplify implementation with argument clinic, better error messages, only __new__

* Use positional-only parameters for the __new__

* Use PyTuple_GET_SIZE and PyTuple_GET_ITEM to tighter the implementation of tuplegetterdescr_get

* Implement __set__ to make tuplegetter a data descriptor

* Use Py_INCREF now that we inline PyTuple_GetItem

* Apply the valid_index() function, saving one test

* Move Py_None test out of the critical path.
Lib/collections/__init__.py
Lib/test/test_collections.py
Misc/NEWS.d/next/Core and Builtins/2018-11-13-01-03-10.bpo-32492.voIdcp.rst [new file with mode: 0644]
Modules/_collectionsmodule.c
Modules/clinic/_collectionsmodule.c.h [new file with mode: 0644]