Identify sources of initial-call overhead when using PyO3 from Python
Determine the specific sources of the initial-call runtime overhead when invoking Rust code from Python via the PyO3 Rust crate and quantify the contribution of each source to the total overhead, including crossing the Python Foreign Function Interface boundary, loading the Python module, and performing data type conversions.
References
The specific sources of the overhead cost for the first call are uncertain---possibilities include crossing the FFI boundary, loading the Python module, data type coversions, etc.---however, future research is required to determine the contribution of each source.
— Improving Runtime Performance of Tensor Computations using Rust From Python
(2510.01495 - Harding et al., 1 Oct 2025) in Section 3, Methodology (timing instrumentation paragraph)