Skip to content

Conversation

@DeeJayLSP
Copy link
Contributor

@DeeJayLSP DeeJayLSP commented Jul 25, 2025

No need for a loop of String conversions with String comparisons, which are much slower.

Before (#135 implementation):

  • Detect if icon path starts with uid://
  • Open UID cache and get each entry
  • Convert the entry's id to text (slow)
  • Compare to icon path (string comparison, slow)
  • Once the corresponding UID is found, give it to icon_path

After

  • Detect if icon path starts with uid://
  • Convert the icon path UID to an integer just once
  • Check if the UID is valid. If not, skip the last steps entirely.
  • Open UID cache and get each entry
  • Compare the entry id to the icon id (integer comparison, fast)
  • Once the corresponding UID is found, give it to icon_path

Like I mentioned in #135, I did the same procedure done in Godot itself, but turns out it had this tiny overhead. I submitted this change there too.

Of course, this has been tested before submitting.

@MakovWait
Copy link
Owner

Thanks!

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