Skip to content

Cache the climbing check in activation range#12764

Merged
Owen1212055 merged 11 commits intoPaperMC:dev/26.1from
Toffikk:dev/cache-climbing
Apr 5, 2026
Merged

Cache the climbing check in activation range#12764
Owen1212055 merged 11 commits intoPaperMC:dev/26.1from
Toffikk:dev/cache-climbing

Conversation

@Toffikk
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Toffikk commented Jun 30, 2025

rebased to .7

@Toffikk
Copy link
Copy Markdown
Contributor Author

Toffikk commented Oct 3, 2025

rebased for 1.21.9))

@Toffikk
Copy link
Copy Markdown
Contributor Author

Toffikk commented Dec 7, 2025

rebased this for 1.21.11

@Toffikk
Copy link
Copy Markdown
Contributor Author

Toffikk commented Jan 4, 2026

rebased again^

@Toffikk
Copy link
Copy Markdown
Contributor Author

Toffikk commented Jan 11, 2026

hey, don’t mean to push or anything, but could this get looked at during the next pr party? all this does is a simple one-line change too so it shouldn’t be a hassle

@Toffikk
Copy link
Copy Markdown
Contributor Author

Toffikk commented Mar 13, 2026

hey, this pr has been approved for 9 months now. is there a chance it'll get merged before the 1 year anniversary? xD

@Toffikk Toffikk changed the base branch from main to dev/26.1 April 5, 2026 00:08
@Toffikk
Copy link
Copy Markdown
Contributor Author

Toffikk commented Apr 5, 2026

@Owen1212055 I rebased this for 26.1.1

@Owen1212055 Owen1212055 merged commit 3d1da60 into PaperMC:dev/26.1 Apr 5, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting final testing to Merged in Paper PR Queue Apr 5, 2026
@Toffikk Toffikk deleted the dev/cache-climbing branch April 5, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

2 participants