Skip to content

Conversation

@Toffikk
Copy link
Contributor

@Toffikk Toffikk commented Jun 29, 2025

This pr aims to reduce the overhead of checking multiple times per tick if an entity is climbing. It does it by caching the last climbing block pos and checking if its the same as the current pos and returning early.

In my testing it helps to reduce the tick time spent on entities and the climbing related logic such as setClimbing now taking 0.02% of the tick time instead of 0.06%

Before:
https://spark.lucko.me/cV9CmdEmwJ

After:
https://spark.lucko.me/7PDoTbgYhA

Entities on which these sparks were conducted are spiders

note: a version of this patch was also used in forks such as Pufferfish and Airplane and provided great results when paired with huge entity numbers

@Toffikk Toffikk requested a review from a team as a code owner June 29, 2025 18:16
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Jun 29, 2025
@Toffikk Toffikk force-pushed the dev/cache-climbing branch from 9228d26 to 097b19f Compare June 29, 2025 18:51
@Toffikk Toffikk changed the title Cache the climbing check Cache the climbing check in activation range Jun 29, 2025
@Toffikk Toffikk force-pushed the dev/cache-climbing branch from 097b19f to be20af6 Compare June 29, 2025 18:57
@Toffikk Toffikk force-pushed the dev/cache-climbing branch from 1c2bf20 to cdb40e3 Compare June 29, 2025 21:27
@github-project-automation github-project-automation bot moved this from Awaiting review to Awaiting final testing in Paper PR Queue Jun 30, 2025
@Toffikk
Copy link
Contributor Author

Toffikk commented Jun 30, 2025

rebased to .7

@Toffikk
Copy link
Contributor Author

Toffikk commented Oct 3, 2025

rebased for 1.21.9))

@Toffikk
Copy link
Contributor Author

Toffikk commented Dec 7, 2025

rebased this for 1.21.11

@Toffikk
Copy link
Contributor Author

Toffikk commented Jan 4, 2026

rebased again^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting final testing

Development

Successfully merging this pull request may close these issues.

2 participants