Skip to content

onRenderAfterWorld causes heavy performance overhead by calling getRenderer on every TileEntity each frame #75

Description

@x8vxv8x

Description:
In EventManager.onRenderAfterWorld(), the code iterates over world.loadedTileEntityList every frame and calls TileEntityRendererDispatcher.instance.getRenderer(tile) on each TileEntity, solely to check if the renderer implements the ITileEntitySpecialRendererLater interface.

The actual late-render functionality is only needed for TileEntityAlchemyTablet. Since it is the sole implementor, a simple instanceof check can be used directly instead of retrieving the renderer. Tested in a large modpack, a profiler shows this method alone takes 5.18% of frame time, with ~4.66% spent inside getRenderer and its injected lookups.

Image

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