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

Reduce bootstrap cost of StringConcatFactory prependers

    XMLWordPrintable

Details

    Description

      Two observations:
      - prependers where both arguments are null are common in typical expressions - caching these is profitable
      - prepender argument ordering is unfortunate: String prefix, <arg>, String suffix. This means we have to do two back-to-back insertArguments rather than one

      Additionally we should add a bridge to the String mix function in StringConcatHelper to avoid method handle invokes in the bootstrap path.

      Patch: http://cr.openjdk.java.net/~redestad/8245756/open.00/

      All together I see a substantial improvement on a number of concatenation bootstrap stress tests. For example, running: http://cr.openjdk.java.net/~redestad/scratch/erase_scf_types.00/ObjStringCombos.java with perf stat -r .. shows these numbers before:

           4,257,229,918 instructions # 1.10 insn per cycle ( +- 0.84% )
             847,230,764 branches # 504.826 M/sec ( +- 0.87% )
              34,600,787 branch-misses # 4.08% of all branches ( +- 0.91% )
             0.319545331 seconds time elapsed ( +- 1.18% )

      And after:

           3,692,867,129 instructions # 1.10 insn per cycle ( +- 0.73% )
             734,054,515 branches # 498.753 M/sec ( +- 0.74% )
              30,699,692 branch-misses # 4.18% of all branches ( +- 0.75% )
             0.295842958 seconds time elapsed ( +- 1.10% )

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: