Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-139609

Performance of /tag command is abysmal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.18.10.20 Beta, 1.18.10
    • 1.17.40.21 Beta, 1.17.30.22 Beta, 1.17.11 Hotfix
    • None
    • Confirmed
    • Windows
    • 627199

      The bug

      The performance of the /tag add and /tag remove commands is exceedingly poor, so bad that you can easily crash a server using them.

      Details

      The performance of these commands is inversely proportional to the number of unique tags that any entity has had this session. That means that when you freshly open the game, and no entities have tags, /tag performs decently. Every time you add a "new" tag to an entity that hasn't been seen before this session, the performance of subsequent /tag commands gets worse.

      It gets bad, fast. If there are no tags in the world, adding and removing the same tag repeatedly can be done thousands of times per tick. But if a single entity somewhere has 500 unique tags, doing the same thing will instantly kill the server.

      How this is even possible, I don't know. Tags should just be a per-entity hash set, and extremely efficient. Currently, tags are far less efficient than scoreboards, despite having strictly less associated information.

      How to reproduce

      1. Download and open the attached world
      2. Follow the instructions on the signs

            tryashtar [Mod] tryashtar
            Votes:
            11 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: