Message352800
> If you care of _PyLong_Copy() performance, you should somehow manually inline _PyLong_New() inside _PyLong_Copy().
It doesn't solve this:
> We could add a function that bypass that check, but in LTO build PyObject_MALLOC() is inlined into _PyLong_New() and it also checks the size. Adding Py_ASSUME((size_t)size <= MAX_LONG_DIGITS) allows to bypass both checks.
Here's example: https://github.com/sir-sigurd/cpython/commit/c8699d0c614a18d558216ae7d432107147c95c28.
I attach some disassembly from this example compiled with LTO, to demonstrate how the proposed macro affects generated code. |
|
Date |
User |
Action |
Args |
2019-09-19 15:27:43 | sir-sigurd | set | recipients:
+ sir-sigurd, vstinner |
2019-09-19 15:27:43 | sir-sigurd | set | messageid: <1568906863.55.0.658893589316.issue38147@roundup.psfhosted.org> |
2019-09-19 15:27:43 | sir-sigurd | link | issue38147 messages |
2019-09-19 15:27:43 | sir-sigurd | create | |
|