Antoine Pitrou wrote: > On Fri, 16 Apr 2021 18:08:58 -0000 > "Denis Kotov" redrad...@gmail.com wrote: > > Okay lets try to discuss one by one: > > > > 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%.
Rust have 2 ref count classes Rc and Arc. First is without atomic, single threaded, second is with atomic and could be used in multiple thread. It is possible to implement the same std::ref_ptr like Rc without atomic variables _______________________________________________ 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/BOYTNQSCUXBWHUXZFE7RZSBWQQZZRZ5M/ Code of Conduct: http://python.org/psf/codeofconduct/