Skip to content

Conversation

Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Jun 11, 2025

Same idea as above - we want to avoid accidentally converting to String, because it's expensive.

Some questionable String conversions are exposed in this PR. The most egregious are repeated calls for the same conversion in loops, and others are using NodePath to verify that a string is path-like, and immediately converting back. If any of these are on hot paths, they should be fixed as a follow-up.

After this PR (and #107406), there are just 2 implicit String operator conversions left:

  • Variant - probably can't fix this now, Variant has all the implicit conversions.
  • StringName - probably fine for now since it's usually fast (at least on repeated access).

So that concludes the String journey for now - but there's tons more implicit conversions elsewhere too 🫣
To be continued...

@Ivorforce Ivorforce added this to the 4.x milestone Jun 11, 2025
@Ivorforce Ivorforce requested review from a team as code owners June 11, 2025 14:24
@Ivorforce Ivorforce requested review from a team as code owners June 11, 2025 14:24
@Ivorforce Ivorforce requested review from a team as code owners June 11, 2025 14:24
@Ivorforce Ivorforce removed request for a team June 11, 2025 14:24
@Ivorforce Ivorforce force-pushed the node-path-string-explicit branch from b5e2ded to e2931a5 Compare June 11, 2025 16:11
@Ivorforce Ivorforce requested a review from a team as a code owner June 11, 2025 16:11
@Ivorforce Ivorforce removed the request for review from a team June 11, 2025 16:22
@akien-mga akien-mga merged commit ae48482 into godotengine:master Jun 12, 2025
39 of 40 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga modified the milestones: 4.x, 4.5 Jun 12, 2025
@Ivorforce Ivorforce deleted the node-path-string-explicit branch June 12, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants