Message260518
"Theoretically, an object type that consistently allocates more than the small object threshold would perform a bit slower because it would first jump to the small object allocator, do the size comparison and then jump to malloc."
I expect that the cost of the extra check is *very* cheap (completly negligible) compared to the cost of a call to malloc().
To have an idea of the cost of the Python code around system allocators, you can take a look at the Performance section of my PEP 445 which added an indirection to all Python allocators:
https://www.python.org/dev/peps/pep-0445/#performances
I was unable to measure an overhead on macro benchmarks (perf.py). The overhead on microbenchmarks was really hard to measure because it was so low that benchmarks were very unable. |
|
Date |
User |
Action |
Args |
2016-02-19 11:12:45 | vstinner | set | recipients:
+ vstinner, florin.papa, catalin.manciu |
2016-02-19 11:12:45 | vstinner | set | messageid: <1455880365.01.0.0599772710283.issue26382@psf.upfronthosting.co.za> |
2016-02-19 11:12:44 | vstinner | link | issue26382 messages |
2016-02-19 11:12:44 | vstinner | create | |
|