Polymorph (Fabric 1.16.1 - 1.19.2)

Polymorph (Fabric 1.16.1 - 1.19.2)

12M Downloads

Polymorph creates a lot of lag on large servers

jeremiahwinsley opened this issue ยท 5 comments

commented

Versions (Be specific, do not write "latest"):

  • Polymorph: 0.33
  • Forge/Fabric: 36.2.19

Observed Behavior:

On large modpacks/servers (tested on ATM6 1.8.11), Polymorph is taking up way too much server time with the new world tick behavior.

Spark profile here (/spark profile --timeout 30): https://spark.lucko.me/jgvWx2yg6W

zipped in case the link expires: spark-profile.zip

2021-12-05 21_34_14-Profile at 09_29PM 12_5_2021

Expected Behavior:

Recipes should not be constantly rescanned - scanning once on world load and on reloads should be enough, since that's the only time recipes change.

commented

Recipes should not be constantly rescanned - scanning once on world load and on reloads should be enough, since that's the only time recipes change.

That's not what Polymorph does during the world tick. Although I understand the confusion based on the naming, getRecipeData is just used to grab the capability that manages the recipe conflict from a block entity. It does not have any other processing or scanning logic.

Thanks for providing the Spark profile, I'll have to investigate this further to see what exactly is causing the lag issue.

commented

I've attempted a small fix that could help alleviate this issue. Since I do not have access to your exact world and ecosystem, I lack the ability to fully test its efficacy, which I would like to do before making this a public release. Would you mind testing this snapshot build and let me know if it helps the lag at all?
polymorph-forge-1.16.5-0.34-SNAPSHOT20211210.zip

commented

Taken with same chunks loaded:
with 0.33: https://spark.lucko.me/dQRmu6YpyB
with 0.34: https://spark.lucko.me/yXD8kmXHD6

Seems like it's using about half the server time, but still a lot more than 0.25 (which is what we're currently using).

commented

Hm, strange profile results. It looks like the performance issue was only partially caused by what I previously assumed. Based on those last results, I can only guess that this is caused by attempting to process a large number of tile/block entities.

I have another build that I'd like you to test if you don't mind:
polymorph-forge-1.16.5-0.34-SNAPSHOT20211213.zip

I've done the most aggressive optimization that I can think of for this build, so I'm hoping this will bring the performance much closer to the 0.25 version.

I would try testing this on my own but I have trouble reproducing the scale of the server where I think this particular performance impact could be noticed.

commented

I've gone ahead and released the update with the above change. Please let me know if this continues to be a problem and I'll re-open this issue.