Don't use streams for VoxelShape calls#2355
Closed
Cryptite wants to merge 6 commits into
Closed
Conversation
Spottedleaf
reviewed
Jul 22, 2019
Spottedleaf
reviewed
Jul 22, 2019
Spottedleaf
reviewed
Jul 22, 2019
Member
|
try to keep the ABI intact (i.e convert stream params to list for param forwarding) and //paper comments need to be added |
|
the last thing mojang cares about is performance. nice find 👍 |
Contributor
|
Is it perhaps also a problem in the 1.14? |
bet |
Contributor
|
Still lots of broken ABI in this PR |
Contributor
Author
|
I'm unlikely to revisit this patch for 1.13.2. Welcome to close it or let somebody else take over but I'd rather redo the work in 1.14 or such rather than be behind. |
Member
|
I've found that this patch is not as relevant in 1.14 |
|
https://sparkprofiler.github.io/#plFv0FVL4R It looks like for me that voxelshape is cusing laggs in 1.14.4, isnt it? |
MisterVector
pushed a commit
to MisterVector/Paper
that referenced
this pull request
Dec 7, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per @electronicboy's suggestion.
Streams aren't performant with hot code and Mojang uses them quite frequently. It was suggested to try to revert stream calls in VoxelShape back to traditional for loops and Lists. Doing so seems to have increased the speed of Entity.move() from 13-22% on some cursory testing:
With 1.13.2 latest Paper (about 200.8ms per call when sampling)

With this patch (about 175.1ms per call when sampling)

The testing scenario for these profilings were just a simply small pen of about 195 or so Pigs:
