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

RISC-V: String.indexOf intrinsic may produce misaligned memory loads

XMLWordPrintable

    • b03
    • riscv
    • linux

        I was profiling renaissance's finagle-http for misaligned memory reads and found few cases in String.indexOf intrinsic.

        For example ( trp_lam is a perf event for misaligned read faults):

        #
        # Samples: 20K of event 'trp_lam'
        # Event count (approx.): 63238
        #
        # Overhead Command Shared Object Symbol
        # ........ ............... ................. ..................................................
        #
            84.40% finagle/netty4- [JIT] tid 21164 [.] int java.lang.String.indexOf(java.lang.String)
            14.75% java [JIT] tid 21164 [.] int java.lang.String.indexOf(java.lang.String)
             0.77% finagle-http-wo [JIT] tid 21164 [.] int java.lang.String.indexOf(java.lang.String)

        Later I found this also can be partialy reproduced with StringIndexOf.advancedWithMediumSub jmh test

        In some cases, String.IndexOf intrinsic performance could be up to 50x times worse than expected. ( on h/w without misaligned access support)

              vkempik Vladimir Kempik
              vkempik Vladimir Kempik
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: