Message259447
Patch version 6: I inlined PyFunction_GetSpecializedCode() into fast_function() of Python/ceval.c. It reduces *a little bit* the overhead of the patch when specialization is not used, but it also avoids to expose this function. I don't think that it's worth to expose PyFunction_GetSpecializedCode(): it was only used in ceval.c. For example, I don't use it for unit tests. I prefer to write tests calling the function and checking the results (see test_pep510.py).
*Raw* overhead of specialized-6.patch on calling "def f(): pass": 1.7 nanoseconds. I computed the overhead using timeit:
./python -m timeit -s 'def f(): pass' 'f()'
* Original: 71.7 ns
* specialize-6.patch: 73.4 ns (+1.7 ns, +2.4%)
* specialize-5.patch: 74.3 ns (+2.6 ns, +3.6%)
I will run perf.py to see the overhead on a macro benchmark. |
|
Date |
User |
Action |
Args |
2016-02-03 00:01:52 | vstinner | set | recipients:
+ vstinner |
2016-02-03 00:01:50 | vstinner | set | messageid: <1454457710.98.0.180819781748.issue26098@psf.upfronthosting.co.za> |
2016-02-03 00:01:50 | vstinner | link | issue26098 messages |
2016-02-03 00:01:50 | vstinner | create | |
|