Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of PoiCompetitorScan by unrolling stream #11871

Merged
merged 5 commits into from
Jan 4, 2025

Conversation

ChromMob
Copy link
Contributor

I was debugging villagers and I noticed that the reduce on the stream has massive overhead so I decided to unroll it.
Here are sparks for before and after:
Before
After
Those numbers are with 229 active villagers on R7 5700X with 64GB of RAM.
image
Here is the test world:
world.tar.gz

@ChromMob ChromMob requested a review from a team as a code owner December 31, 2024 10:55
Copy link
Member

@Warriorrrr Warriorrrr left a comment

Choose a reason for hiding this comment

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

Since it's changing minecraft code, this can still use some paper comments

@vadcx
Copy link

vadcx commented Dec 31, 2024

The profiling results look very impressive. You may have forgotten to return the winner to ifPresent? .reduce

@ChromMob
Copy link
Contributor Author

The profiling results look very impressive. You may have forgotten to return the winner to ifPresent? .reduce

The result wasn't used at all before so there is no need to return anything because the only thing it does is the sideffect.

@lynxplay lynxplay force-pushed the poicompetitorscan-improvements branch from 745c836 to fe1642a Compare January 3, 2025 21:14
@lynxplay lynxplay merged commit 6ab1352 into PaperMC:main Jan 4, 2025
lynxplay pushed a commit to notTamion/paper that referenced this pull request Jan 4, 2025
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.

6 participants