Message390002
I wrote a microbenchmark on Py_INCREF()+Py_DECREF():
$ python3 -m pyperf compare_to ref.json limited.json
Mean +- std dev: [ref] 3.45 ns +- 0.17 ns -> [limited] 6.03 ns +- 0.21 ns: 1.75x slower
If a function is only made of Py_INCREF() and Py_DECREF(), it can be up to 1.8x slower in the worst case. But in practice, I don't think that functions are only made of Py_INCREF() and Py_DECREF(). They do a few other things.
I'm not sure how to run a "macro benchmark" on my PR 25131, since I don't know any C extension doing anything useful. There is xxlimited, but it does almost nothing.
What would be a fair benchmark for this change?
--
To run my microbenchmark:
git apply bench.patch
./configure --with-lto --enable-optimizations
make
./python -m venv env
./env/bin/python -m pip install pyperf
./env/bin/python ../bench_limited.py -o ../limited.json -v
./env/bin/python ../bench_testcapi.py -o ../ref.json -v |
|
Date |
User |
Action |
Args |
2021-04-01 17:04:01 | vstinner | set | recipients:
+ vstinner, petr.viktorin |
2021-04-01 17:04:01 | vstinner | set | messageid: <1617296641.18.0.31249479086.issue43688@roundup.psfhosted.org> |
2021-04-01 17:04:01 | vstinner | link | issue43688 messages |
2021-04-01 17:04:01 | vstinner | create | |
|