Details

    • b05
    • riscv

    Description

      There are different string comparison (UU/LL/UL/LU), and there are 2 implementation, scalar and vector versions. And both implementation are bit complicated, so it's worth to double check both implementations and verify the performance gain of vector version.

      There is improvement in some cases, but also bring some regression in some cases, especially for compareToUU.

      ## tested on K230-CanMV
      warmup: 10 times
      iteration: 10 times


      Benchmark (size) Score+rvv Score-rvv
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLL 24 4242936.876 7227607.14 1.703
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLL 36 5738695.363 8157070.353 1.421
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLL 72 7163243.984 7209568.036 1.006
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLL 128 8627566.301 12720927.51 1.474
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLL 256 14632020.04 16291127.26 1.113
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLL 512 26539410.59 23612505.95 0.89
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLU 24 4913490.894 10454585.94 2.128
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLU 36 7230036.286 13561865.48 1.876
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLU 72 9525418.104 21901656.51 2.299
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLU 128 12645301.4 37351484.04 2.954
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLU 256 21147886.68 64886475.43 3.068
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToLU 512 39738017.94 125169103.6 3.15
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUL 24 5183884.427 11040441.7 2.13
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUL 36 7421224.1 13879329.16 1.87
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUL 72 9739241.916 22346979.93 2.295
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUL 128 12115336.28 35576652.6 2.936
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUL 256 21473923.71 65486723.87 3.05
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUL 512 39885299.16 126584284.1 3.174
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUU 24 5869568.01 6264293.13 1.067
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUU 36 7426068.273 7166385.007 0.965
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUU 72 10526248.56 11169251.07 1.061
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUU 128 15267275.25 14296156.49 0.936
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUU 256 27485452.58 21502833.49 0.782
      com.arm.benchmarks.intrinsics.StringCompareToDifferentLength.compareToUU 512 52373404.61 36336863.6 0.694

      Attachments

        Issue Links

          Activity

            People

              mli Hamlin Li
              mli Hamlin Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: