Skip to content

Severe FPS loss while holding MI hatches with many MI multiblocks built #957

@James103

Description

@James103

Version info

Modern Industrialization 2.2.25
Minecraft 1.21.1
NeoForge 21.1.79
Modpack: Craftoria 1.9.0

Expected result

Reasonably smooth performance, even with dozens or hundreds of multiblocks.

Actual result

When there are a large number of MI multiblocks present in one area, holding an MI hatch in either hand causes a severe FPS drop due to trying to render a large number (thousands) of possible locations for hatches within the multiblock structures.

The linked and attached Spark profile shows this issue with approximately 142 MI multiblocks within the area and holding an MI item input hatch.
https://spark.lucko.me/5XnqRehlIZ or 5XnqRehlIZ.zip

A large amount of the additional time is spent calling this function repeatedly (once per possible hatch location per frame totaling tens of thousands of calls per second).

RenderHelper.drawOverlay(matrices, vcp, 111f / 256, 1, 111f / 256, 15728880, overlay);

Steps to reproduce

  1. Build a few dozen MI multiblock structures in one area (ideally in a superflat world or void dimension).
  2. Hold an MI hatch in your hand.
  3. Notice the loss in FPS.

The actual performance impact is proportional to the number of possible hatch locations (green overlay boxes), which depends on the number and type of multiblock structures present – multiblocks with more flexible hatch placement have a bigger FPS impact while the player is holding a hatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions