title: Performance benefits of a static empty array instance
body: <p>It seems common practice to extract a constant empty array return value into a static constant. Like here:</p>
  
  <pre><code>public class NoopParser implements Parser {
      private static final String[] EMPTY_ARRAY = new String[0];
  
      @Override public String[] supportedSchemas() {
          return EMPTY_ARRAY;
      }
  
      // ...
  }
  </code></pre>
  
  <p>Presumably this is done for performance reasons, since returning <code>new String[0]</code> directly would create a new array object every time the method is called – but would it really?</p>
  
  <p>I've been wondering if there really is a measurable performance benefit in doing this or if it's just outdated folk wisdom. An empty array is immutable. Is the VM not able to roll all empty <code>String</code> arrays into one? Can the VM not make <code>new String[0]</code> basically free of cost?</p>
  
  <p>Contrast this practice with returning an empty String: we're usually perfectly happy to write <code>return "";</code>, not <code>return EMPTY_STRING;</code>.</p>