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

Optimization for Integer.toString

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • core-libs
    • None
    • b15

      Create on behalf of shaojin.wensj@alibaba-inc.com
      ----
      2. MacBookPro M1 Pro
      Integers.toStringTiny (-17.29%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringTiny 500 avgt 15 2.338 ± 0.033 us/op
      +Integers.toStringTiny 500 avgt 15 2.827 ± 0.035 us/op
      Integers.toStringSmall (+22.06%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringSmall 500 avgt 15 4.465 ± 0.057 us/op
      +Integers.toStringSmall 500 avgt 15 3.658 ± 0.296 us/op
      Integers.toStringBig (+266.63%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringBig 500 avgt 15 17.866 ± 4.029 us/op
      +Integers.toStringBig 500 avgt 15 4.873 ± 0.049 us/op
      StringBuilders.toStringCharWithInt8 (+848.31%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithInt8 avgt 15 133.475 ± 81.002 ns/op
      +StringBuilders.toStringCharWithInt8 avgt 15 14.075 ± 0.045 ns/op
      StringBuilders.toStringCharWithIntTiny (+1.38%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntTiny avgt 15 1512.647 ± 25.371 ns/op
      +StringBuilders.toStringCharWithIntTiny avgt 15 1491.986 ± 3.917 ns/op
      StringBuilders.toStringCharWithIntSmall (+78.29%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntSmall avgt 15 4068.938 ± 25.371 ns/op
      +StringBuilders.toStringCharWithIntSmall avgt 15 2281.476 ± 6.398 ns/op
      StringBuilders.toStringCharWithIntBig (+46.30%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntBig avgt 15 6470.144 ± 255.504 ns/op
      +StringBuilders.toStringCharWithIntBig avgt 15 4422.480 ± 18.456 ns/op
      3. aliyun_c8i.xlarge
      cpu : intel xeon sapphire rapids (x64)

      Integers.toStringTiny (+6.73%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringTiny 500 avgt 15 3.770 ± 0.060 us/op
      +Integers.toStringTiny 500 avgt 15 3.532 ± 0.074 us/op
      Integers.toStringSmall (+22.41%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringSmall 500 avgt 15 4.708 ± 0.013 us/op
      +Integers.toStringSmall 500 avgt 15 3.846 ± 0.019 us/op
      Integers.toStringBig (+30.98%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringBig 500 avgt 15 6.747 ± 0.018 us/op
      +Integers.toStringBig 500 avgt 15 5.151 ± 0.018 us/op
      StringBuilders.toStringCharWithInt8 (+187.46%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithInt8 avgt 15 88.928 ± 1.044 ns/op
      +StringBuilders.toStringCharWithInt8 avgt 15 30.935 ± 18.380 ns/op
      StringBuilders.toStringCharWithIntTiny (-28.43%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntTiny avgt 15 1761.961 ± 44.235 ns/op
      +StringBuilders.toStringCharWithIntTiny avgt 15 2462.206 ± 1.777 ns/op
      StringBuilders.toStringCharWithIntSmall (+72.88%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntSmall avgt 15 5652.977 ± 44.235 ns/op
      +StringBuilders.toStringCharWithIntTiny avgt 15 3269.803 ± 6.171 ns/op
      StringBuilders.toStringCharWithIntBig (+43.93%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntBig avgt 15 9861.697 ± 44.235 ns/op
      +StringBuilders.toStringCharWithIntBig avgt 15 6851.668 ± 41.018 ns/op
      4. aliyun_c8a.xlarge
      cpu : amd epc genoa (x64)

      Integers.toStringTiny (+3.10%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringTiny 500 avgt 15 2.754 ± 0.007 us/op
      +Integers.toStringTiny 500 avgt 15 2.671 ± 0.146 us/op
      Integers.toStringSmall (+27.86%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringSmall 500 avgt 15 4.483 ± 0.005 us/op
      +Integers.toStringSmall 500 avgt 15 3.506 ± 0.075 us/op
      Integers.toStringBig (+35.50%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringBig 500 avgt 15 6.759 ± 0.008 us/op
      +Integers.toStringBig 500 avgt 15 4.988 ± 0.024 us/op
      StringBuilders.toStringCharWithInt8 (+134.39%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithInt8 avgt 15 93.225 ± 2.948 ns/op
      +StringBuilders.toStringCharWithInt8 avgt 15 39.773 ± 0.249 ns/op
      StringBuilders.toStringCharWithIntTiny (-27.31%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntTiny avgt 15 1746.719 ± 0.893 ns/op
      +StringBuilders.toStringCharWithIntTiny avgt 15 2403.254 ± 3.055 ns/op
      StringBuilders.toStringCharWithIntSmall (+104.05%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntSmall avgt 15 5493.827 ± 0.893 ns/op
      +StringBuilders.toStringCharWithIntSmall avgt 15 2692.291 ± 3.055 ns/op
      StringBuilders.toStringCharWithIntBig (+50.79%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntBig avgt 15 8731.999 ± 0.893 ns/op
      +StringBuilders.toStringCharWithIntBig avgt 15 5790.750 ± 3.055 ns/op
      5. aliyun_c8y.xlarge
      cpu : aliyun yitian 710 (aarch64)

      Integers.toStringTiny (-11.37%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringTiny 500 avgt 15 6.200 ± 0.112 us/op
      +Integers.toStringTiny 500 avgt 15 6.996 ± 0.162 us/op
      Integers.toStringSmall (+0.22%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringSmall 500 avgt 15 7.204 ± 0.153 us/op
      +Integers.toStringSmall 500 avgt 15 7.188 ± 0.255 us/op
      Integers.toStringBig (+44.12%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringBig 500 avgt 15 11.942 ± 0.249 us/op
      +Integers.toStringBig 500 avgt 15 8.286 ± 0.291 us/op
      StringBuilders.toStringCharWithInt8 (+52.27%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithInt8 avgt 15 52.941 ± 0.702 ns/op
      +StringBuilders.toStringCharWithInt8 avgt 15 34.653 ± 0.817 ns/op
      StringBuilders.toStringCharWithIntTiny (+3.01%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntTiny avgt 15 2359.117 ± 0.844 ns/op
      +StringBuilders.toStringCharWithIntTiny avgt 15 2290.051 ± 10.707 ns/op
      StringBuilders.toStringCharWithIntSmall (+65.62%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntSmall avgt 15 6242.325 ± 0.844 ns/op
      +StringBuilders.toStringCharWithIntSmall avgt 15 3768.949 ± 9.792 ns/op
      StringBuilders.toStringCharWithIntBig (+63.70%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntBig avgt 15 11493.624 ± 358.937 ns/op
      +StringBuilders.toStringCharWithIntBig avgt 15 7020.785 ± 326.069 ns/op
      6. Orange Pi 5 Plus
      cpu : RK3588 (aarch64)

      Integers.toStringTiny (-11.14%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringTiny 500 avgt 15 7.981 ± 0.115 us/op
      +Integers.toStringTiny 500 avgt 15 8.979 ± 0.147 us/op
      Integers.toStringSmall (+33.79%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringSmall 500 avgt 15 12.827 ± 0.190 us/op
      +Integers.toStringSmall 500 avgt 15 9.587 ± 0.150 us/op
      Integers.toStringBig (+64.91%)
       Benchmark (size) Mode Cnt Score Error Units
      -Integers.toStringBig 500 avgt 15 20.530 ± 0.219 us/op
      +Integers.toStringBig 500 avgt 15 12.449 ± 0.188 us/op
      StringBuilders.toStringCharWithInt8 (+95.58%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithInt8 avgt 15 95.399 ± 2.568 ns/op
      +StringBuilders.toStringCharWithInt8 avgt 15 48.775 ± 1.320 ns/op
      StringBuilders.toStringCharWithIntTiny (+11.78%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntTiny avgt 15 4715.996 ± 106.712 ns/op
      +StringBuilders.toStringCharWithIntTiny avgt 15 4218.791 ± 47.060 ns/op
      StringBuilders.toStringCharWithIntSmall (+65.39%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntSmall avgt 15 12202.075 ± 106.712 ns/op
      +StringBuilders.toStringCharWithIntSmall avgt 15 7377.331 ± 119.671 ns/op
      StringBuilders.toStringCharWithIntSmall (+61.98%)
       Benchmark Mode Cnt Score Error Units
      -StringBuilders.toStringCharWithIntBig avgt 15 21904.673 ± 901.208 ns/op
      +StringBuilders.toStringCharWithIntBig avgt 15 13522.576 ± 1010.084 ns/op

            yyang Yi Yang
            yyang Yi Yang
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: