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 mass crafts #9603

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

Machine-Maker
Copy link
Member

@Machine-Maker Machine-Maker commented Aug 13, 2023

See patch description for a breakdown of this.

To test the performance implications I used spark's profiler and tickmonitor both set to report ticks over 55ms. Doing 3 mass crafts without this patch resulted in this. With this patch, none of the crafts tripped the tickmonitor or profiler.

There are probably further improvements done. Like the slotChangedCraftingGrid static method in CraftingMenu is called 576 times to re-calculate the recipe for a full 9 stack shift-click craft. This calls the PrepareItemCraftEvent 576 times and sends that many packets setting the result slot content.


Download the paperclip jar for this pull request: paper-9603.zip

@Machine-Maker Machine-Maker requested a review from a team as a code owner August 13, 2023 22:45
@kennytv kennytv added the build-pr-jar Enables a workflow to build Paperclip jars on the pull request. label Aug 14, 2023
@Machine-Maker Machine-Maker force-pushed the fix/shift-click-craft-perf branch from 07a91a2 to 0f31d07 Compare August 21, 2023 03:54
@kennytv kennytv force-pushed the fix/shift-click-craft-perf branch from 0f31d07 to 2d52866 Compare August 21, 2023 08:59
@Machine-Maker Machine-Maker force-pushed the fix/shift-click-craft-perf branch from 2d52866 to be54532 Compare August 21, 2023 14:07
@kennytv kennytv force-pushed the fix/shift-click-craft-perf branch from be54532 to 928cfc9 Compare August 22, 2023 05:39
@kennytv kennytv merged commit 9395aa6 into PaperMC:master Aug 22, 2023
@Machine-Maker Machine-Maker deleted the fix/shift-click-craft-perf branch August 22, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-pr-jar Enables a workflow to build Paperclip jars on the pull request.
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

2 participants