All Questions

Community

L
Eric Langlais

move and get_parent()

Isn't it slower to call get_parent() at every function calls instead of getting it once at the top?
  • Nathan Lovato replied
    I'd have to look at the implementation on the backend. Probably not significantly: get_parent() might just be a getter for a parent property of the node. With only one state running at a time, it's really nothing performance-wise. The reason we're not getting the parent once at the top is that you need a coroutine to do so and because not all states have a parent state. In the final project on GitHub we ended up having some variable for the parent state, and I'll probably show that in the next course.