Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-198787

Inefficient Streams in Goal Selector

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.16.2, 21w03a, 21w05b, 21w08b, 21w19a
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Plausible
    • Category:
      Performance

      Description

      The goal selector since 1.13 switched to expensive stream and lambda constructs which waste a lot of AI performance every tick.

      We reverted our mod goal selector back to the original goal selector with for loops ( + some cleanup) to preserve this performance. (Link: https://github.com/ldtteam/minecolonies/blob/d1ebb34de4124bbba9f535c9e3b81b79639b89fd/src/api/java/com/minecolonies/api/entity/CustomGoalSelector.java)
      A huge chunk of the vanilla entity performance sinks here atm.

      Streams should not be used in performance critical places where the collection has only very few values (most entities have a very limited amount of goals).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              raycoms Ray Neiheiser
              Votes:
              4 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                CHK: