Skip to content

Are nested table lookups in the same function optimized? #479

Answered by zeux
JDaance asked this question in Q&A
Discussion options

You must be logged in to vote

We currently don't optimize this pattern, so indeed using locals to cache the intermediate lookups can be beneficial for performance. We do plan to look into optimizing cases like this because they are surprisingly prevalent; doing this is likely going to require some subtle changes to the semantics of the language, so it's not something we can do quickly or easily as we'd need to evaluate the impact on compatibility.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@JDaance
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by JDaance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants