Skip to content

Conversation

@ProdPreva1l
Copy link

@ProdPreva1l ProdPreva1l commented Oct 30, 2025

This reduces allocation count 3x (from 3n -> n, where n is total tick times)

Ive done some decent testing and havent observed any difference in the result of the method.

This is allocations (bytes) per second.

Before
image

After
image

Tested with

public final class Erm extends JavaPlugin {
    private int tickCount = 0;

    @Override
    public void onEnable() {
        new BukkitRunnable() {
            @Override
            public void run() {
                boolean lagging = Bukkit.getTPS()[0] < 18;

                if (++tickCount % 20 == 0 && lagging) {
                    getLogger().info("Server has less than 18 TPS.");
                }
            }
        }.runTaskTimer(this, 1L, 1L);
    }
}

@ProdPreva1l ProdPreva1l requested a review from a team as a code owner October 30, 2025 10:56
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Oct 30, 2025
Copy link
Member

@jpenilla jpenilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to Moonrise files need to be done in that repo first https://github.com/Tuinity/Moonrise

@github-project-automation github-project-automation bot moved this from Awaiting review to Changes required in Paper PR Queue Oct 30, 2025
granny added a commit to PurpurMC/Purpur that referenced this pull request Oct 31, 2025
SoSeDiK added a commit to SoSeDiKs-Universe/Kiterino that referenced this pull request Oct 31, 2025
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@ffe2f809 Add option to disable Warden Sonic Boom (#1713)
PurpurMC/Purpur@3d61a214 Updated Upstream (Paper)
PurpurMC/Purpur@626a3cb2 port PaperMC/Paper#13256 to further reduce impact of tick time calculations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Changes required

Development

Successfully merging this pull request may close these issues.

2 participants