Le 18 nov. 2017 08:32, "Serhiy Storchaka" <storch...@gmail.com> a écrit :

Making PyTuple_GET_ITEM() a function will destroy the half of the benefit.
And this will make the ABI larger.


Sorry if I wasn't explicit about it: my idea of changing the API has an
obvious impact on performance. That's why the first step on the second
milestone of my plan is to spend time to measure the slowdown.

The other part of the my overall plan is to experiement new optimizations.
See my draft PEP for ideas.

The idea behind adding PyTuple_GET_ITEM() is to be able to compile C
extensions using it, without having to modify the code. If you require to
modify the code, I don't expect that you will be able to compile more than
half of C extensions on PyPI, like old code with no active maintainer...

Anyway, the PyTuple_GET_ITEM() will remain a macro in the default API for
Python 3.7.

See also my blog post which explains why the fact that it is a macro
prevents us from optimizing it, like having specialized compact tuple for
small integers.

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to