On Tue, 27 Oct 2026 17:21:32 GMT, Andrew Haley <[email protected]> wrote:
>> Please use [this >> link](https://github.com/openjdk/jdk/pull/28541/changes?w=1) to view the >> files changed. >> >> Profile counters scale very badly. >> >> The overhead for profiled code isn't too bad with one thread, but as the >> thread count increases, things go wrong very quickly. >> >> For example, here's a benchmark from the OpenJDK test suite, run at >> TieredLevel 3 with one thread, then three threads: >> >> >> Benchmark (randomized) Mode Cnt Score Error Units >> InterfaceCalls.test2ndInt5Types false avgt 4 27.468 ± 2.631 ns/op >> InterfaceCalls.test2ndInt5Types false avgt 4 240.010 ± 6.329 ns/op >> >> >> This slowdown is caused by high memory contention on the profile counters. >> Not only is this slow, but it can also lose profile counts. >> >> This patch is for C1 only. It'd be easy to randomize interpreter counters as >> well in another PR, if anyone thinks it's worth doing. >> >> One other thing to note is that randomized profile counters degrade very >> badly with small decimation ratios. For example, using a ratio of 2 with >> `-XX:ProfileCaptureRatio=2` with a single thread results in >> >> >> Benchmark (randomized) Mode Cnt Score Error >> Units >> InterfaceCalls.test2ndInt5Types false avgt 4 80.147 ± 9.991 >> ns/op >> >> >> The problem is that the branch prediction rate drops away very badly, >> leading to many mispredictions. It only really makes sense to use higher >> decimation ratios, e.g. 64. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Andrew Haley has updated the pull request incrementally with one additional > commit since the last revision: > > Silence MacOS compiler. The uncommon trap count regression seems to be gone! I can see one config where first iterations are considerably faster when I set a giant PCR, but the steady state is still slower to achieve. # Ryzen 9950X, distribute across all CCX-es $ taskset -c 0-3,8-11 ./run-renaissance.sh dotty -r 20 dotty -r 20 --- Patched, PCR=1 Run 1: 4326 1440 1037 823 761 650 622 592 535 514 476 511 451 452 453 425 432 410 394 390 Run 2: 4382 1434 1060 916 780 696 650 570 541 521 519 486 461 457 441 425 425 403 397 409 Run 3: 4173 1483 1001 923 747 662 611 557 538 503 488 500 453 448 445 424 410 411 402 401 Tier1: 0.043 s, 9747 bytes, 2136 methods; Tier2: 1.514 s, 1222241 bytes, 6952 methods; Tier3: 3.891 s, 2337675 bytes, 12766 methods; Tier4: 43.960 s, 5769281 bytes, 6342 methods; Uncommon traps hit: 398 ... --- Patched, PCR=16384 Run 1: 3967 1373 997 825 743 693 638 613 565 566 556 590 575 595 568 552 548 545 481 478 Run 2: 3914 1373 991 822 727 662 623 596 569 550 543 519 520 507 504 488 488 488 479 473 Run 3: 3852 1385 1027 822 734 687 631 600 593 565 547 535 526 524 504 500 493 495 477 477 Tier1: 0.034 s, 9773 bytes, 2142 methods; Tier2: 0.380 s, 306761 bytes, 1811 methods; Tier3: 3.686 s, 2424264 bytes, 14852 methods; Tier4: 22.989 s, 2905419 bytes, 6351 methods; Uncommon traps hit: 457 BTW, this fails right away with ` -XX:+AggressiveProfileReduction`: $ build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx4g -Xms4g -XX:+UseTransparentHugePages -XX:+AlwaysPreTouch -XX:ReservedCodeCacheSize=256M -XX:+AggressiveProfileReduction -XX:+UseG1GC -XX:ProfileCaptureRatio=4 -jar renaissance-gpl-0.16.1.jar dotty -r 20 [2026-10-27T19:21:53.168+0100] org.renaissance.core (org.renaissance.core.Launcher main) SEVERE: Harness failed with java.lang.NoClassDefFoundError: scala/collection/immutable/Seq at org.renaissance.harness.RenaissanceSuite.main(RenaissanceSuite.scala) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:583) at org.renaissance.core.Launcher.loadAndInvokeHarnessClass(Launcher.java:125) at org.renaissance.core.Launcher.launchHarnessClass(Launcher.java:74) at org.renaissance.core.Launcher.main(Launcher.java:43) Caused by: java.lang.ClassNotFoundException: scala.collection.immutable.Seq at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:377) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:558) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:491) ... 6 more ------------- PR Comment: https://git.openjdk.org/jdk/pull/28541#issuecomment-6450236432
