Inada Naoki <songofaca...@gmail.com> added the comment:
First of all, this is just deprecating direct access of `ob_shash`. This makes users need to use `PyObject_Hash()`. We don't make the final decision about removing it. We just make we can remove it in Python 3.13. RAM and CACHE efficiency is not the only motivation for this. There is a discussion about (1) increasing CoW efficiency, and (2) sharing data between subinterpreters after per-interpreter GIL. Removing ob_shash will help them, especially about the (2). But if we stop using bytes objects in code objects by Python 3.13, there is no need to remove ob_shash. > If put a bytes object into multiple dicts/sets, the hash need to be computed > multiple times. This seems a common usage. Doesn't it lose only some milliseconds? I posted remove-bytes-hash.patch in this issue. Would you measure how this affects whole application performance rather than micro benchmarks? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46864> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com