Even in *C* inline rarely gives a significant speedup these days. If your code is running too slowly, then the first two things to look at are, in my experience:
- run the problem function fewer times
- change the algorithm
For the former, something like
Memoize is a good drop-in tool, although you can generally do better with code tailored specifically to what you're doing (but at the cost of having to write the damned code and debug it yourself).