Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

Massive GUI lag when using 3 artisan tools in the Blacksmith's workshop o_O

Freebi85 opened this issue ยท 2 comments

commented

Issue Description

When using a script with 3 artisan tools and a liquid in the Blacksmith workshop, the GUI lag is insane. Nearly impossible to move items into workshop or change things. Is happens also in other Workshops but it's not that crazy like in the Blacksmith one for some reason.
FYI Downgrading Artisan Worktables to 1.22.10 and Artisan Integrations to 1.0 solves the issue for now

What You Expect to Happen

To work smooth^^

Script

here is a script from one of my workshop recipes. you can change the liquid just with water or lava to test i guess.

recipes.remove(<minecraft:iron_helmet>);

RecipeBuilder.get("blacksmith")
  .setShaped([
	[<ore:plateIron>, <ore:plateIron>, <ore:plateIron>, <ore:plateIron>, <ore:plateIron>], 
	[<ore:plateIron>, <ore:plateIron>, <ore:plateIron>, <ore:plateIron>, <ore:plateIron>], 
	[<ore:plateIron>, null, null, null, <ore:plateIron>], 
	[null, null, null, null, null], 
	[null, null, null, null, null]])
  .setFluid(<liquid:methane> * 1500)
  .addOutput(<minecraft:iron_helmet>)
  .addTool(<ore:artisansBurner>, 12)
  .addTool(<ore:artisansHammer>, 12)
  .addTool(<ore:artisansPliers>, 5)
  .create();

Affected Versions

  • Minecraft: 1.12
  • Forge: .2847
  • CraftTweaker: 4.1.19
  • Artisan Worktables: 1.22.11 and all above
  • Athenaeum: 1.17.4
commented

@Freebi85, thank you for the report!

I have reproduced this problem in the DD&SS pack, 6.4b with AW 1.22.11.

I've made some optimizations to the AW recipe search that significantly improve its performance:

  • pre-calculate and cache expensive or iterative calls
  • restrict client-side recipe lookup to clients without an integrated server running
  • move recipe matrix check before tool check to leverage the early out

Tests

To test the optimizations, I injected an additional ~2000 recipes for the blacksmith table on top of the ~2000 recipes in the DD&SS pack, for a total of ~4000 recipes.

The worst case scenario is when no recipe matches, AW will have tried matching all ~4000 recipes and an additional ~9000 vanilla recipes as well. This worst case happens significantly more often than the case where a recipe is matched, excluding shift+click crafts as AW is already optimized to look at the previously matched recipe first.

image

The above image displays the results of searching ~4000 blacksmith recipes and ~9000 vanilla recipes after the optimizations.

TLDR;

This should be fixed in 1.22.14.

The table is significantly more usable now in DD&SS, but still has a bottleneck at the vanilla recipe search.

Since the vanilla search is performed the same way that vanilla tables do their search, I don't know how to optimize this right now, or if it even can be optimized. If the table lag is still a problem, and you don't really need the vanilla recipes in the AW tables, I would recommend turning off the vanilla recipe table feature in the config.

commented

Wow thank you very much! amazing how quickly it was done. Gonna disable the vanilla recipes if it becomes a problem again :)
<3