Skip to content

Conversation

Keno
Copy link
Member

@Keno Keno commented Feb 5, 2025

No description provided.

if isdefined(mod, newname)
newmod = getfield(mod, newname)
if invokelatest(isdefined, mod, newname)
newmod = invokelatest(getfield, mod, newname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between invokelatest vs. @invokelatest here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invokelatest will be marginally faster since it doesn't need to re-lookup the getfield binding.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we're still missing the optimization to make invokelatest on intrinsics fast, so it doesn't really make a difference right now.

@Keno Keno merged commit 3ab3a11 into master Feb 5, 2025
6 of 10 checks passed
@aviatesk aviatesk deleted the kf/112updates branch June 25, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants