Inline the layout-related methods as these basically change types and could benefit from cold branch removal.#332
Conversation
… could benefit from cold branch removal.
|
Sorry for the delayed review, this looks good to me 👍 I had stalled for a bit because these are generic functions and based off the discussion at PyO3/pyo3#2326 (comment) I wasn't sure if this achieves anything. I just took a chance to play around with So my conclusion is that:
Because they're generic functions this presumably also doesn't carry as much of a compile-time cost as marking a non-generic function So in summary, looks like there's definitely value in adding this. cc @mejrs might be interesting to you too. |
I would try to summarize things by "Generic function are available for cross-crate inlining independently of the inline attribute, but being generic by itself does increase the likelihood of being inlined." In the end, this change here is probably not affecting things too much either way as LLVM's infamous heuristic for inlining seems to be "yes"... |
No description provided.