Skip to content

Major TPS Lag: ColoringFanProcessingType performs expensive recipe lookups on every Chute/BlockEntity tick #58

@jetstrike

Description

@jetstrike

Evidence
Spark Report: https://spark.lucko.me/QLxjMXJof5

Description
A significant performance bottleneck has been identified in Create: Dragons Plus where the ColoringFanProcessingType logic causes extreme server lag. This occurs when a Create Smart Chute interacts with an inventory while a filter is present.

The mod appears to be scanning the global RecipeManager for shapeless recipes via StackedContents.canCraft() every time a SmartBlockEntity checks for item validity.

Steps to Reproduce
Install Create and Create: Dragons Plus.

Place a Smart Chute or Brass Funnel pulling from a large inventory (e.g., an Item Vault or a Storage Network).

Apply an Attribute Filter or any filter that triggers the canAcceptItem check. (Cannot Be Stained, Is Dyed X)

Observe the TPS drop as the mod repeatedly executes ColoringFanProcessingType.canProcess.

Spark Profiler
The profiler shows that ChuteBlockEntity.handleInput() calls FilteringBehaviour.test(), which eventually triggers CDPItemAttributes.lambda$colorFanProcessing$3().

The stack trace leads to:

plus.dragons.createdragonsplus.common.kinetics.fan.coloring.ColoringFanProcessingType.processByCrafting()

net.minecraft.world.item.crafting.RecipeManager.getRecipeFor()

net.minecraft.world.entity.player.StackedContents.canCraft()

Environment
Minecraft Version: NeoForge 1.21.1

Create Version: v6.0.9

Create: Dragons Plus Version: 1.8.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions