On Fri, 16 Apr 2021 18:08:58 -0000
"Denis Kotov" <redrad...@gmail.com> wrote:
> 
> Okay lets try to discuss one by one:
> 1) Readability - less code, most code is hidden by abstraction without losing 
> performance
> In CPython code lots of stuff like Py_INCREF, Py_DECREF .. it could be fixed 
> with C++ std::shared_ptr<> (RustPython use analog Arc<>)

std::shared_ptr<> would be a bad replacement for CPython's reference
counting for two reasons:

1) the reference count is maintained in a separate memory block (unless
you were careful enough to use std::make_shared() for allocation)

2) the reference count is atomic, and this has been proven to slow down
CPython by 10-20%.

That does not mean that CPython couldn't benefit from C++-based
abstractions, but they would have to be implemented (or taken from
another project such as pybind11).

Regards

Antoine.


_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/YEXWX6NT5W533PFIJVXAKHQWJCY43BDZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to