| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Argument Clinic supports positional-only arguments for the limited C API.
|
With this change, _statistics._normal_dist_inv_cdf() uses less efficient code to parse its arguments:
|
Sorry, something went wrong.
|
Micro-benchmark on Linux with CPU isolation, Python built with -O3 (without LTO, without PGO): $ python -m pyperf compare_to ref.json limited.json Mean +- std dev: [ref] 88.6 ns +- 1.5 ns -> [limited] 160 ns +- 1 ns: 1.81x slower Code: import _statistics
import pyperf
p = 0.5
mu = 0.0
sigma = 1.0
runner = pyperf.Runner()
runner.bench_func('inv_cdf', _statistics._normal_dist_inv_cdf, p, mu, sigma)
|
Sorry, something went wrong.
|
I'm not sure if the _statistics is a good candidate for this work on converting stdlib extensions to the limited C API. The Lib/statistics.py module has a pure Python implementation, and the C code is there for optimization. So I would expect best performance for that. Moreover, the function is quite fast, around 100 ns, so the cost of argument parsing is significant. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Argument Clinic supports positional-only arguments for the limited C API.