Skip to content

Optimize MapItemSavedData#tickCarriedBy #9597

@lynxplay

Description

@lynxplay

Description of issue

MapItemSavedData#tickCarriedBy is currently used by both a map itemstack ticked inside an ItemFrame as well as the items in the player inventory.

Given that maps can be duplicated, MapItemSavedData#tickCarriedBy is potentially called multiple times per tick, for each instance of the map around (either in player inventories or item frames). #tickCarriedBy however is terribly designed in regards to the duplicate existence of the same map and should be thoroughly investigated for potential performance improvements:

Examples

carriedByPlayers is used to track which players currently carry the map. However, the itemframe calls this method for each player tracking the itemframe entity, meaning that in a single tick, a player may be added to said list just to be removed later by the iteration through the carried list.

The tickCarriedBy additionally loads Decorations from the compound tag of the item stack over and over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: performancestatus: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions