Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8245094

Reduce overhead of initializing the StringConcatFactory default strategy

XMLWordPrintable

      During initialization, we currently lookup a handle to get the initialCoder:

      try {
          MethodHandle initCoder = JLA.stringConcatHelper("initialCoder", methodType(long.class));
          INITIAL_CODER = (long) initCoder.invoke();
      } catch (Throwable e) {
          throw new AssertionError(e);
      }

      Supplying a shared secret method in JLA instead reduces initialization overhead by a few million instructions (~0.5ms).

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: