RFR: 8285255: refine StringLatin1.regionMatchesCI_UTF16 [v3]
XenoAmess
duke at openjdk.java.net
Wed Apr 20 21:55:24 UTC 2022
On Wed, 20 Apr 2022 21:19:14 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> XenoAmess has updated the pull request incrementally with one additional commit since the last revision:
>>
>> remove = check
>
> Can you run the JMH against the code before either change (or an existing JDK).
> It would be interesting to quantify the improvements of going straight to Latin1.
>
> (Understanding current hardware architectures and their parallelism is hard to understand well.
> They do clever things with branch prediction and potentially optimistically executing both paths
> and then discarding the non-branch case. The existing code for toLower and toUpper already includes a branch or two; adding one more branch to the sequence likely can't be optimized.)
>
> These interactions at the instruction level is why measuring is important.
> Thanks
@RogerRiggs
seems all 4 tests related runs very very slightlier slower in original codes, before change it to CharacterDataLatin1.instance
<details>
<summary>Jmh Result (original)</summary>
<p>
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.charAt
# Run progress: 0.00% complete, ETA 00:06:00
# Fork: 1 of 3
# Warmup Iteration 1: 70.457 ns/op
# Warmup Iteration 2: 73.255 ns/op
# Warmup Iteration 3: 71.446 ns/op
# Warmup Iteration 4: 73.454 ns/op
# Warmup Iteration 5: 73.618 ns/op
# Warmup Iteration 6: 72.853 ns/op
# Warmup Iteration 7: 74.493 ns/op
# Warmup Iteration 8: 74.862 ns/op
# Warmup Iteration 9: 74.323 ns/op
# Warmup Iteration 10: 73.759 ns/op
Iteration 1: 73.053 ns/op
Iteration 2: 70.180 ns/op
Iteration 3: 70.337 ns/op
Iteration 4: 73.237 ns/op
Iteration 5: 73.156 ns/op
# Run progress: 4.17% complete, ETA 00:05:52
# Fork: 2 of 3
# Warmup Iteration 1: 72.617 ns/op
# Warmup Iteration 2: 71.344 ns/op
# Warmup Iteration 3: 73.582 ns/op
# Warmup Iteration 4: 73.309 ns/op
# Warmup Iteration 5: 74.078 ns/op
# Warmup Iteration 6: 75.177 ns/op
# Warmup Iteration 7: 72.578 ns/op
# Warmup Iteration 8: 72.028 ns/op
# Warmup Iteration 9: 72.897 ns/op
# Warmup Iteration 10: 69.317 ns/op
Iteration 1: 69.303 ns/op
Iteration 2: 69.157 ns/op
Iteration 3: 69.078 ns/op
Iteration 4: 69.142 ns/op
Iteration 5: 70.084 ns/op
# Run progress: 8.33% complete, ETA 00:05:36
# Fork: 3 of 3
# Warmup Iteration 1: 72.149 ns/op
# Warmup Iteration 2: 73.753 ns/op
# Warmup Iteration 3: 70.621 ns/op
# Warmup Iteration 4: 74.384 ns/op
# Warmup Iteration 5: 71.787 ns/op
# Warmup Iteration 6: 74.946 ns/op
# Warmup Iteration 7: 74.463 ns/op
# Warmup Iteration 8: 73.403 ns/op
# Warmup Iteration 9: 71.675 ns/op
# Warmup Iteration 10: 72.550 ns/op
Iteration 1: 66.963 ns/op
Iteration 2: 72.209 ns/op
Iteration 3: 71.639 ns/op
Iteration 4: 71.262 ns/op
Iteration 5: 74.514 ns/op
Result "org.openjdk.bench.java.lang.StringOther.charAt":
70.888 ±(99.9%) 2.207 ns/op [Average]
(min, avg, max) = (66.963, 70.888, 74.514), stdev = 2.064
CI (99.9%): [68.681, 73.094] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.compareTo
# Run progress: 12.50% complete, ETA 00:05:21
# Fork: 1 of 3
# Warmup Iteration 1: 7.648 ns/op
# Warmup Iteration 2: 7.576 ns/op
# Warmup Iteration 3: 7.024 ns/op
# Warmup Iteration 4: 7.595 ns/op
# Warmup Iteration 5: 7.605 ns/op
# Warmup Iteration 6: 7.555 ns/op
# Warmup Iteration 7: 7.573 ns/op
# Warmup Iteration 8: 7.592 ns/op
# Warmup Iteration 9: 7.673 ns/op
# Warmup Iteration 10: 7.255 ns/op
Iteration 1: 7.268 ns/op
Iteration 2: 7.183 ns/op
Iteration 3: 7.267 ns/op
Iteration 4: 7.253 ns/op
Iteration 5: 7.248 ns/op
# Run progress: 16.67% complete, ETA 00:05:06
# Fork: 2 of 3
# Warmup Iteration 1: 7.654 ns/op
# Warmup Iteration 2: 7.626 ns/op
# Warmup Iteration 3: 7.006 ns/op
# Warmup Iteration 4: 7.610 ns/op
# Warmup Iteration 5: 7.564 ns/op
# Warmup Iteration 6: 7.566 ns/op
# Warmup Iteration 7: 7.561 ns/op
# Warmup Iteration 8: 7.554 ns/op
# Warmup Iteration 9: 7.525 ns/op
# Warmup Iteration 10: 7.156 ns/op
Iteration 1: 7.137 ns/op
Iteration 2: 7.173 ns/op
Iteration 3: 7.180 ns/op
Iteration 4: 7.168 ns/op
Iteration 5: 7.239 ns/op
# Run progress: 20.83% complete, ETA 00:04:50
# Fork: 3 of 3
# Warmup Iteration 1: 7.595 ns/op
# Warmup Iteration 2: 7.556 ns/op
# Warmup Iteration 3: 6.966 ns/op
# Warmup Iteration 4: 7.513 ns/op
# Warmup Iteration 5: 7.546 ns/op
# Warmup Iteration 6: 7.415 ns/op
# Warmup Iteration 7: 7.449 ns/op
# Warmup Iteration 8: 7.557 ns/op
# Warmup Iteration 9: 7.485 ns/op
# Warmup Iteration 10: 7.210 ns/op
Iteration 1: 7.234 ns/op
Iteration 2: 7.165 ns/op
Iteration 3: 7.194 ns/op
Iteration 4: 7.195 ns/op
Iteration 5: 7.255 ns/op
Result "org.openjdk.bench.java.lang.StringOther.compareTo":
7.210 ±(99.9%) 0.046 ns/op [Average]
(min, avg, max) = (7.137, 7.210, 7.268), stdev = 0.043
CI (99.9%): [7.164, 7.257] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.internUnique
# Run progress: 25.00% complete, ETA 00:04:35
# Fork: 1 of 3
# Warmup Iteration 1: 721.255 ns/op
# Warmup Iteration 2: 738.384 ns/op
# Warmup Iteration 3: 787.659 ns/op
# Warmup Iteration 4: 855.374 ns/op
# Warmup Iteration 5: 1162.055 ns/op
# Warmup Iteration 6: 1366.581 ns/op
# Warmup Iteration 7: 1576.950 ns/op
# Warmup Iteration 8: 1707.555 ns/op
# Warmup Iteration 9: 1909.602 ns/op
# Warmup Iteration 10: 1991.609 ns/op
Iteration 1: 2126.098 ns/op
Iteration 2: 2247.201 ns/op
Iteration 3: 2365.506 ns/op
Iteration 4: 2481.897 ns/op
Iteration 5: 2602.970 ns/op
# Run progress: 29.17% complete, ETA 00:04:20
# Fork: 2 of 3
# Warmup Iteration 1: 732.419 ns/op
# Warmup Iteration 2: 734.784 ns/op
# Warmup Iteration 3: 776.857 ns/op
# Warmup Iteration 4: 862.338 ns/op
# Warmup Iteration 5: 1161.400 ns/op
# Warmup Iteration 6: 1390.485 ns/op
# Warmup Iteration 7: 1564.553 ns/op
# Warmup Iteration 8: 1740.864 ns/op
# Warmup Iteration 9: 1886.047 ns/op
# Warmup Iteration 10: 1996.744 ns/op
Iteration 1: 2134.201 ns/op
Iteration 2: 2237.158 ns/op
Iteration 3: 2373.474 ns/op
Iteration 4: 2480.673 ns/op
Iteration 5: 2600.095 ns/op
# Run progress: 33.33% complete, ETA 00:04:05
# Fork: 3 of 3
# Warmup Iteration 1: 723.303 ns/op
# Warmup Iteration 2: 730.116 ns/op
# Warmup Iteration 3: 747.244 ns/op
# Warmup Iteration 4: 870.327 ns/op
# Warmup Iteration 5: 1163.600 ns/op
# Warmup Iteration 6: 1391.905 ns/op
# Warmup Iteration 7: 1609.695 ns/op
# Warmup Iteration 8: 1747.073 ns/op
# Warmup Iteration 9: 1901.428 ns/op
# Warmup Iteration 10: 2037.695 ns/op
Iteration 1: 2138.309 ns/op
Iteration 2: 2261.873 ns/op
Iteration 3: 2379.407 ns/op
Iteration 4: 2495.306 ns/op
Iteration 5: 2598.640 ns/op
Result "org.openjdk.bench.java.lang.StringOther.internUnique":
2368.187 ±(99.9%) 183.667 ns/op [Average]
(min, avg, max) = (2126.098, 2368.187, 2602.970), stdev = 171.803
CI (99.9%): [2184.520, 2551.855] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.regionMatchesLatin1
# Run progress: 37.50% complete, ETA 00:03:49
# Fork: 1 of 3
# Warmup Iteration 1: 27.793 ns/op
# Warmup Iteration 2: 27.260 ns/op
# Warmup Iteration 3: 26.885 ns/op
# Warmup Iteration 4: 26.953 ns/op
# Warmup Iteration 5: 27.178 ns/op
# Warmup Iteration 6: 26.945 ns/op
# Warmup Iteration 7: 27.820 ns/op
# Warmup Iteration 8: 27.217 ns/op
# Warmup Iteration 9: 27.922 ns/op
# Warmup Iteration 10: 27.038 ns/op
Iteration 1: 26.504 ns/op
Iteration 2: 26.891 ns/op
Iteration 3: 26.936 ns/op
Iteration 4: 26.798 ns/op
Iteration 5: 26.750 ns/op
# Run progress: 41.67% complete, ETA 00:03:34
# Fork: 2 of 3
# Warmup Iteration 1: 27.393 ns/op
# Warmup Iteration 2: 27.862 ns/op
# Warmup Iteration 3: 26.308 ns/op
# Warmup Iteration 4: 27.392 ns/op
# Warmup Iteration 5: 27.782 ns/op
# Warmup Iteration 6: 27.679 ns/op
# Warmup Iteration 7: 27.454 ns/op
# Warmup Iteration 8: 26.879 ns/op
# Warmup Iteration 9: 27.335 ns/op
# Warmup Iteration 10: 26.984 ns/op
Iteration 1: 26.375 ns/op
Iteration 2: 26.432 ns/op
Iteration 3: 26.588 ns/op
Iteration 4: 26.340 ns/op
Iteration 5: 26.378 ns/op
# Run progress: 45.83% complete, ETA 00:03:19
# Fork: 3 of 3
# Warmup Iteration 1: 27.703 ns/op
# Warmup Iteration 2: 27.526 ns/op
# Warmup Iteration 3: 26.139 ns/op
# Warmup Iteration 4: 27.495 ns/op
# Warmup Iteration 5: 27.239 ns/op
# Warmup Iteration 6: 27.491 ns/op
# Warmup Iteration 7: 26.857 ns/op
# Warmup Iteration 8: 27.469 ns/op
# Warmup Iteration 9: 27.390 ns/op
# Warmup Iteration 10: 26.636 ns/op
Iteration 1: 26.784 ns/op
Iteration 2: 26.685 ns/op
Iteration 3: 26.630 ns/op
Iteration 4: 26.664 ns/op
Iteration 5: 26.914 ns/op
Result "org.openjdk.bench.java.lang.StringOther.regionMatchesLatin1":
26.645 ±(99.9%) 0.217 ns/op [Average]
(min, avg, max) = (26.340, 26.645, 26.936), stdev = 0.203
CI (99.9%): [26.427, 26.862] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.regionMatchesU1024LL
# Run progress: 50.00% complete, ETA 00:03:03
# Fork: 1 of 3
# Warmup Iteration 1: 384.034 ns/op
# Warmup Iteration 2: 386.145 ns/op
# Warmup Iteration 3: 192.375 ns/op
# Warmup Iteration 4: 385.160 ns/op
# Warmup Iteration 5: 388.339 ns/op
# Warmup Iteration 6: 394.354 ns/op
# Warmup Iteration 7: 389.876 ns/op
# Warmup Iteration 8: 392.541 ns/op
# Warmup Iteration 9: 396.471 ns/op
# Warmup Iteration 10: 189.031 ns/op
Iteration 1: 191.889 ns/op
Iteration 2: 191.517 ns/op
Iteration 3: 189.627 ns/op
Iteration 4: 189.437 ns/op
Iteration 5: 188.183 ns/op
# Run progress: 54.17% complete, ETA 00:02:48
# Fork: 2 of 3
# Warmup Iteration 1: 386.763 ns/op
# Warmup Iteration 2: 387.674 ns/op
# Warmup Iteration 3: 188.244 ns/op
# Warmup Iteration 4: 386.972 ns/op
# Warmup Iteration 5: 394.980 ns/op
# Warmup Iteration 6: 393.451 ns/op
# Warmup Iteration 7: 385.662 ns/op
# Warmup Iteration 8: 386.794 ns/op
# Warmup Iteration 9: 388.771 ns/op
# Warmup Iteration 10: 188.608 ns/op
Iteration 1: 191.659 ns/op
Iteration 2: 190.469 ns/op
Iteration 3: 190.416 ns/op
Iteration 4: 191.333 ns/op
Iteration 5: 193.085 ns/op
# Run progress: 58.33% complete, ETA 00:02:33
# Fork: 3 of 3
# Warmup Iteration 1: 386.921 ns/op
# Warmup Iteration 2: 386.713 ns/op
# Warmup Iteration 3: 192.961 ns/op
# Warmup Iteration 4: 388.269 ns/op
# Warmup Iteration 5: 396.061 ns/op
# Warmup Iteration 6: 392.936 ns/op
# Warmup Iteration 7: 392.474 ns/op
# Warmup Iteration 8: 397.539 ns/op
# Warmup Iteration 9: 395.017 ns/op
# Warmup Iteration 10: 192.466 ns/op
Iteration 1: 188.695 ns/op
Iteration 2: 189.254 ns/op
Iteration 3: 189.562 ns/op
Iteration 4: 191.183 ns/op
Iteration 5: 191.548 ns/op
Result "org.openjdk.bench.java.lang.StringOther.regionMatchesU1024LL":
190.524 ±(99.9%) 1.462 ns/op [Average]
(min, avg, max) = (188.183, 190.524, 193.085), stdev = 1.368
CI (99.9%): [189.061, 191.986] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.regionMatchesU1024LU
# Run progress: 62.50% complete, ETA 00:02:17
# Fork: 1 of 3
# Warmup Iteration 1: 1886.842 ns/op
# Warmup Iteration 2: 1951.907 ns/op
# Warmup Iteration 3: 1336.138 ns/op
# Warmup Iteration 4: 1969.057 ns/op
# Warmup Iteration 5: 1977.544 ns/op
# Warmup Iteration 6: 1955.080 ns/op
# Warmup Iteration 7: 1955.399 ns/op
# Warmup Iteration 8: 1948.878 ns/op
# Warmup Iteration 9: 1974.372 ns/op
# Warmup Iteration 10: 1325.548 ns/op
Iteration 1: 1324.446 ns/op
Iteration 2: 1317.174 ns/op
Iteration 3: 1320.426 ns/op
Iteration 4: 1322.694 ns/op
Iteration 5: 1354.689 ns/op
# Run progress: 66.67% complete, ETA 00:02:02
# Fork: 2 of 3
# Warmup Iteration 1: 1881.938 ns/op
# Warmup Iteration 2: 1940.219 ns/op
# Warmup Iteration 3: 1331.686 ns/op
# Warmup Iteration 4: 1966.264 ns/op
# Warmup Iteration 5: 1959.955 ns/op
# Warmup Iteration 6: 1943.985 ns/op
# Warmup Iteration 7: 1960.606 ns/op
# Warmup Iteration 8: 1950.825 ns/op
# Warmup Iteration 9: 1953.092 ns/op
# Warmup Iteration 10: 1325.135 ns/op
Iteration 1: 1329.842 ns/op
Iteration 2: 1324.868 ns/op
Iteration 3: 1335.141 ns/op
Iteration 4: 1341.477 ns/op
Iteration 5: 1345.784 ns/op
# Run progress: 70.83% complete, ETA 00:01:47
# Fork: 3 of 3
# Warmup Iteration 1: 1726.861 ns/op
# Warmup Iteration 2: 1760.492 ns/op
# Warmup Iteration 3: 1338.569 ns/op
# Warmup Iteration 4: 1762.623 ns/op
# Warmup Iteration 5: 1767.371 ns/op
# Warmup Iteration 6: 1749.098 ns/op
# Warmup Iteration 7: 1748.149 ns/op
# Warmup Iteration 8: 1768.330 ns/op
# Warmup Iteration 9: 1777.755 ns/op
# Warmup Iteration 10: 1335.878 ns/op
Iteration 1: 1313.298 ns/op
Iteration 2: 1326.874 ns/op
Iteration 3: 1334.138 ns/op
Iteration 4: 1324.629 ns/op
Iteration 5: 1333.529 ns/op
Result "org.openjdk.bench.java.lang.StringOther.regionMatchesU1024LU":
1329.934 ±(99.9%) 11.886 ns/op [Average]
(min, avg, max) = (1313.298, 1329.934, 1354.689), stdev = 11.118
CI (99.9%): [1318.048, 1341.820] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.regionMatchesU1024UL
# Run progress: 75.00% complete, ETA 00:01:31
# Fork: 1 of 3
# Warmup Iteration 1: 1698.300 ns/op
# Warmup Iteration 2: 1792.648 ns/op
# Warmup Iteration 3: 1362.651 ns/op
# Warmup Iteration 4: 1793.508 ns/op
# Warmup Iteration 5: 1776.535 ns/op
# Warmup Iteration 6: 1734.500 ns/op
# Warmup Iteration 7: 1749.249 ns/op
# Warmup Iteration 8: 1733.342 ns/op
# Warmup Iteration 9: 1767.894 ns/op
# Warmup Iteration 10: 1452.358 ns/op
Iteration 1: 1508.769 ns/op
Iteration 2: 1396.692 ns/op
Iteration 3: 1359.459 ns/op
Iteration 4: 1381.066 ns/op
Iteration 5: 1333.066 ns/op
# Run progress: 79.17% complete, ETA 00:01:16
# Fork: 2 of 3
# Warmup Iteration 1: 1722.288 ns/op
# Warmup Iteration 2: 1759.843 ns/op
# Warmup Iteration 3: 1329.077 ns/op
# Warmup Iteration 4: 1746.541 ns/op
# Warmup Iteration 5: 1780.978 ns/op
# Warmup Iteration 6: 1754.303 ns/op
# Warmup Iteration 7: 1755.167 ns/op
# Warmup Iteration 8: 1758.167 ns/op
# Warmup Iteration 9: 1753.601 ns/op
# Warmup Iteration 10: 1318.156 ns/op
Iteration 1: 1336.835 ns/op
Iteration 2: 1307.115 ns/op
Iteration 3: 1318.644 ns/op
Iteration 4: 1319.236 ns/op
Iteration 5: 1328.117 ns/op
# Run progress: 83.33% complete, ETA 00:01:01
# Fork: 3 of 3
# Warmup Iteration 1: 1687.909 ns/op
# Warmup Iteration 2: 1761.530 ns/op
# Warmup Iteration 3: 1325.844 ns/op
# Warmup Iteration 4: 1760.050 ns/op
# Warmup Iteration 5: 1846.705 ns/op
# Warmup Iteration 6: 1831.452 ns/op
# Warmup Iteration 7: 1756.480 ns/op
# Warmup Iteration 8: 1751.992 ns/op
# Warmup Iteration 9: 1737.721 ns/op
# Warmup Iteration 10: 1305.649 ns/op
Iteration 1: 1307.646 ns/op
Iteration 2: 1316.020 ns/op
Iteration 3: 1305.341 ns/op
Iteration 4: 1322.055 ns/op
Iteration 5: 1311.291 ns/op
Result "org.openjdk.bench.java.lang.StringOther.regionMatchesU1024UL":
1343.423 ±(99.9%) 56.946 ns/op [Average]
(min, avg, max) = (1305.341, 1343.423, 1508.769), stdev = 53.267
CI (99.9%): [1286.478, 1400.369] (assumes normal distribution)
# JMH version: 1.34
# VM version: JDK 19-internal, OpenJDK 64-Bit Server VM, 19-internal-adhoc..jdk
# VM invoker: F:\workspace\jdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe
# VM options: -Djava.library.path=f:\workspace\jdk\build\windows-x86_64-server-release\images\test\micro\native
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 1000 ms each
# Measurement: 5 iterations, 1000 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.openjdk.bench.java.lang.StringOther.regionMatchesU1024UU
# Run progress: 87.50% complete, ETA 00:00:45
# Fork: 1 of 3
# Warmup Iteration 1: 384.307 ns/op
# Warmup Iteration 2: 393.025 ns/op
# Warmup Iteration 3: 188.918 ns/op
# Warmup Iteration 4: 388.716 ns/op
# Warmup Iteration 5: 389.077 ns/op
# Warmup Iteration 6: 393.182 ns/op
# Warmup Iteration 7: 396.038 ns/op
# Warmup Iteration 8: 386.322 ns/op
# Warmup Iteration 9: 388.637 ns/op
# Warmup Iteration 10: 188.833 ns/op
Iteration 1: 189.554 ns/op
Iteration 2: 191.854 ns/op
Iteration 3: 190.570 ns/op
Iteration 4: 192.731 ns/op
Iteration 5: 193.851 ns/op
# Run progress: 91.67% complete, ETA 00:00:30
# Fork: 2 of 3
# Warmup Iteration 1: 383.292 ns/op
# Warmup Iteration 2: 390.798 ns/op
# Warmup Iteration 3: 188.544 ns/op
# Warmup Iteration 4: 386.818 ns/op
# Warmup Iteration 5: 385.428 ns/op
# Warmup Iteration 6: 391.337 ns/op
# Warmup Iteration 7: 392.357 ns/op
# Warmup Iteration 8: 395.916 ns/op
# Warmup Iteration 9: 394.474 ns/op
# Warmup Iteration 10: 190.443 ns/op
Iteration 1: 190.693 ns/op
Iteration 2: 191.330 ns/op
Iteration 3: 191.545 ns/op
Iteration 4: 189.648 ns/op
Iteration 5: 190.392 ns/op
# Run progress: 95.83% complete, ETA 00:00:15
# Fork: 3 of 3
# Warmup Iteration 1: 387.182 ns/op
# Warmup Iteration 2: 387.931 ns/op
# Warmup Iteration 3: 191.014 ns/op
# Warmup Iteration 4: 389.244 ns/op
# Warmup Iteration 5: 389.680 ns/op
# Warmup Iteration 6: 387.478 ns/op
# Warmup Iteration 7: 386.103 ns/op
# Warmup Iteration 8: 393.928 ns/op
# Warmup Iteration 9: 394.937 ns/op
# Warmup Iteration 10: 189.155 ns/op
Iteration 1: 189.103 ns/op
Iteration 2: 188.165 ns/op
Iteration 3: 190.563 ns/op
Iteration 4: 192.239 ns/op
Iteration 5: 192.589 ns/op
Result "org.openjdk.bench.java.lang.StringOther.regionMatchesU1024UU":
190.988 ±(99.9%) 1.634 ns/op [Average]
(min, avg, max) = (188.165, 190.988, 193.851), stdev = 1.529
CI (99.9%): [189.354, 192.623] (assumes normal distribution)
# Run complete. Total time: 00:06:07
REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.
NOTE: Current JVM experimentally supports Compiler Blackholes, and they are in use. Please exercise
extra caution when trusting the results, look into the generated code to check the benchmark still
works, and factor in a small probability of new VM bugs. Additionally, while comparisons between
different JVMs are already problematic, the performance difference caused by different Blackhole
modes can be very significant. Please make sure you use the consistent Blackhole mode for comparisons.
Benchmark Mode Cnt Score Error Units
StringOther.charAt avgt 15 70.888 ± 2.207 ns/op
StringOther.compareTo avgt 15 7.210 ± 0.046 ns/op
StringOther.internUnique avgt 15 2368.187 ± 183.667 ns/op
StringOther.regionMatchesLatin1 avgt 15 26.645 ± 0.217 ns/op
StringOther.regionMatchesU1024LL avgt 15 190.524 ± 1.462 ns/op
StringOther.regionMatchesU1024LU avgt 15 1329.934 ± 11.886 ns/op
StringOther.regionMatchesU1024UL avgt 15 1343.423 ± 56.946 ns/op
StringOther.regionMatchesU1024UU avgt 15 190.988 ± 1.634 ns/op
</p>
</details>
-------------
PR: https://git.openjdk.java.net/jdk/pull/8308
More information about the core-libs-dev
mailing list