FancyInnovations / FancyInnovations/FancyPlugins
FancyNpcsPlugin.get() causes many unnecessary memory allocation
- Dominant language
- Java
- Stars
- 88
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
### In which plugin has the error occurred?
FancyNpcs
### What happened?
`getPlugin()` triggers `toLowerCase` calls which allocates memories
I noticed this issue while analyzing memory allocation for the users of my plugin. It is recommended to use a better approach to implement this.
### In which software has the error occurred?
Paper
### Plugin version
2.11.0
### Server version
1.21.11
### Relevant log output
```shell
```
Contributor guide
Research direction
Find the implementation of FancyNpcsPlugin.get() and its getPlugin() path; inspect the toLowerCase calls reported in the issue and the surrounding lookup logic. Confirm the completed change by checking that repeated getPlugin() calls no longer allocate through those conversions while preserving behavior on the reported Paper and plugin versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100