FancyInnovations / FancyInnovations/FancyPlugins

FancyNpcsPlugin.get() causes many unnecessary memory allocation

Open Beginner friendly
#331 0 comments 0 reactions 0 assignees View on GitHub
Priority: Medium Status: Pending Type: Bug
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?

Image

`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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.