Skip to content

Conversation

@samjviana
Copy link

@samjviana samjviana commented Mar 1, 2025

First of all, I want to thank and congratulate you for this mod ... it's insanely helpful!

I mainly did three things here:

  • Refactored the ImageTagHandler: Honestly, I'm not sure why I initially decided to do this refactor, but I can say I wanted to help with code maintenance and performance since this is a mod I always use. As for the comments I usually add for myself, feel free to keep or remove them—I personally find them very helpful for my future self or anyone else who comes across the code.
  • Added the RecurrentErrorLogger as part of the refactor: This should allow errors to be logged in places that are called repeatedly (like the tag handler or any draw method, for instance).
  • Made a simple change to UITextSnippet to improve performance: The way ChatManager.ParseMessage was being called caused snippets to be instantiated way too many times per second. From my analysis, each ImageTagSnippet was being instantiated about 500 times per second, and with this cache change, it's down to ~300 per second. It's not perfect, but it seems to be working as intended.

Feel free to accept or reject any of the changes, and thanks again for your work on this mod!

@samjviana samjviana changed the title refactor ImageTagHandler.cs Refactor ImageTagHandler.cs Mar 1, 2025
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.

1 participant