Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion/Optimization]: String formatting in validateCapability uses a non-negligable amount of resources #118

Open
ShaneParslow opened this issue Jul 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ShaneParslow
Copy link

Mod Loader (Optional)

Forge

Minecraft Version(s) (Optional)

1.19.2

Mod Version(s) (Optional)

4.4.3

Suggestion (Required)

validateCapability in ForgeCapabilityKey uses a fair amount of resources on the main thread for string formatting, regardless of whether the capability is null or not. Changing the string to a constant or using the Supplier<String> overload should fix the issue. I see that the same paradigm is used in a few other places throughout the repo, but I haven't seen issues with any of those.

This seems to significantly hurt the performance of Thin Air, specifically.
thinair_profile

@ShaneParslow ShaneParslow added the enhancement New feature or request label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants