[Python-ideas] Why CPython is still behind in performance for some widely used patterns ?

Barry barry at barrys-emacs.org
Tue Feb 20 15:54:32 EST 2018



> On 20 Feb 2018, at 13:12, Nick Coghlan <ncoghlan at gmail.com> wrote:
> 
>> On 20 February 2018 at 16:17, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> On Mon, 19 Feb 2018 20:15:27 +0100
>> Stefan Behnel <stefan_ml at behnel.de> wrote:
>>> Nick Coghlan schrieb am 02.02.2018 um 06:47:
>>>> to make the various extension module authoring tools
>>>> easier to discover, rather than having folks assuming that handcrafted
>>>> calls directly into the CPython C API is their only option.
>>> 
>>> Or even a competitive option. Tools like Cython or pybind11 go to great
>>> length to shave off every bit of overhead from C-API calls, commonly
>>> replacing high-level C-API functionality with macros and direct access to
>>> data structures. The C/C++ code that they generate is so complex and tuned
>>> that it would be infeasible to write and maintain something like that by
>>> hand, but it can perfectly be generated, and it usually performs visibly
>>> better than most hand-written modules, definitely much better than anything
>>> a non-expert could write.
>>> 
>>> Basically, by not learning the C-API you can benefit from all that highly
>>> tuned and specialised code written by C-API experts that the documentation
>>> doesn't even tell you about.
>> 
>> Doesn't the documentation ever mention Cython? It probably should (no
>> idea about pybind11, which I've never played with). Perhaps you can
>> open an issue about that?
> 
> We mention them in the Extending & Embedding guide, and link out to
> the page on packaging.python.org that describes them in more detail:
> https://docs.python.org/3/extending/index.html#recommended-third-party-tools

Can you add PyCXX to the list please?

Barry

> 
> Cheers,
> Nick.
> 
> P.S. There are also a number of open issues at
> https://github.com/pypa/python-packaging-user-guide/issues regarding
> additional projects that should be mentioned in
> https://packaging.python.org/guides/packaging-binary-extensions/
> 
> -- 
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 



More information about the Python-ideas mailing list