mojira.dev
MC-225425

"/data modify" inserts source elements into target collection one by one

The bug

/data modify ... insert|prepend|append ... inserts the source elements into the target collection one by one, not in batches. Because the internal collection of list tags and array tags are java.util.ArrayList and primitive arrays respectively, this way of insertion slows down performance by repeated unnecessary resizing of the target collection.

This will be resolved by usingĀ java.util.ArrayList#addAll and org.apache.commons.lang3.ArrayUtils#addAll instead of java.util.ArrayList#add and org.apache.commons.lang3.ArrayUtils#add, respectively.

Partially related to MC-221421.

Comments 0

No comments.

intsuc

(Unassigned)

Confirmed

Commands

nbt

1.16.5, 21w19a, 1.17 Pre-release 1, 1.17, 1.17.1, ..., 23w18a, 1.20 Pre-release 7, 1.20.2, 23w42a, 1.21.4

Retrieved