The following operations, such as defining objects, variables, obtaining database connections, and performing unnecessary try-catch operations, should be moved to the outside of the loop for performance purposes. So you have to think about, this is defining variables outside of the loop, is the object defined for that part of the reference, or for that part of the new part? I don’t think it’s business logical to say new, because we often define objects in loops and then put them in containers. If you want to optimize performance by referring to the part of the definition outside, it doesn’t make sense because references are allocated on the stack, and resources allocated on the stack are already allocated at compile time

Paste two graphs, from the bytecode instructions, only one variable slot, is reusable, hope big guys give me the answer