diff --git a/log b/log index a6436ca..8f315c9 100644 --- a/log +++ b/log @@ -1,9 +1,146 @@ -➜ java -Djmh.blackhole.mode=COMPILER -verbose:gc -jar target/benchmark.jar com.github.shautvast.benchmarks.loops.LoopBenchmark -[0.003s][info][gc] Using G1 +❯ mvn clean package +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------------< org.example:MultiDim >------------------------ +[INFO] Building MultiDim 1.0-SNAPSHOT +[INFO] from pom.xml +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] --- clean:3.2.0:clean (default-clean) @ MultiDim --- +[INFO] Deleting /Users/Shautvast/dev/MultiDim/target +[INFO] +[INFO] --- resources:3.3.0:resources (default-resources) @ MultiDim --- +[INFO] Copying 0 resource +[INFO] +[INFO] --- compiler:3.8.0:compile (default-compile) @ MultiDim --- +[INFO] Changes detected - recompiling the module! +[INFO] Compiling 4 source files to /Users/Shautvast/dev/MultiDim/target/classes +[INFO] +[INFO] --- resources:3.3.0:testResources (default-testResources) @ MultiDim --- +[INFO] skip non existing resourceDirectory /Users/Shautvast/dev/MultiDim/src/test/resources +[INFO] +[INFO] --- compiler:3.8.0:testCompile (default-testCompile) @ MultiDim --- +[INFO] Changes detected - recompiling the module! +[INFO] Compiling 1 source file to /Users/Shautvast/dev/MultiDim/target/test-classes +[INFO] +[INFO] --- surefire:3.0.0-M8:test (default-test) @ MultiDim --- +[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider +[INFO] +[INFO] ------------------------------------------------------- +[INFO] T E S T S +[INFO] ------------------------------------------------------- +[INFO] Running com.github.shautvast.benchmarks.arrays.IntArrayTest +[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in com.github.shautvast.benchmarks.arrays.IntArrayTest +[INFO] +[INFO] Results: +[INFO] +[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 +[INFO] +[INFO] +[INFO] --- jar:3.3.0:jar (default-jar) @ MultiDim --- +[INFO] Building jar: /Users/Shautvast/dev/MultiDim/target/MultiDim-1.0-SNAPSHOT.jar +[INFO] +[INFO] --- shade:3.2.4:shade (default) @ MultiDim --- +[INFO] Including org.openjdk.jmh:jmh-core:jar:1.36 in the shaded jar. +[INFO] Including net.sf.jopt-simple:jopt-simple:jar:5.0.4 in the shaded jar. +[INFO] Including org.apache.commons:commons-math3:jar:3.2 in the shaded jar. +[WARNING] MultiDim-1.0-SNAPSHOT.jar, commons-math3-3.2.jar, jmh-core-1.36.jar, jopt-simple-5.0.4.jar define 1 overlapping resource: +[WARNING] - META-INF/MANIFEST.MF +[WARNING] maven-shade-plugin has detected that some class files are +[WARNING] present in two or more JARs. When this happens, only one +[WARNING] single version of the class is copied to the uber jar. +[WARNING] Usually this is not harmful and you can skip these warnings, +[WARNING] otherwise try to manually exclude artifacts based on +[WARNING] mvn dependency:tree -Ddetail=true and the above output. +[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/ +[INFO] Replacing /Users/Shautvast/dev/MultiDim/target/benchmark.jar with /Users/Shautvast/dev/MultiDim/target/MultiDim-1.0-SNAPSHOT-shaded.jar +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESS +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 1.742 s +[INFO] Finished at: 2023-08-28T21:17:27+02:00 +[INFO] ------------------------------------------------------------------------ + +MultiDim on  main [!] via ☕ v20.0.1 took 2s +➜ java -Djmh.blackhole.mode=COMPILER -cp target/benchmark.jar com.github.shautvast.benchmarks.loops.LoopBenchmark +Exception in thread "main" org.openjdk.jmh.runner.ProfilersFailedException: Profilers failed to initialize, exiting. + at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:228) + at org.openjdk.jmh.runner.Runner.run(Runner.java:209) + at com.github.shautvast.benchmarks.loops.LoopBenchmark.main(LoopBenchmark.java:72) +Caused by: org.openjdk.jmh.profile.ProfilerException: [sudo: a password is required +] + at org.openjdk.jmh.profile.DTraceAsmProfiler.(DTraceAsmProfiler.java:69) + at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67) + at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) + at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484) + at org.openjdk.jmh.profile.ProfilerFactory.instantiate(ProfilerFactory.java:82) + at org.openjdk.jmh.profile.ProfilerFactory.getProfiler(ProfilerFactory.java:77) + at org.openjdk.jmh.profile.ProfilerFactory.getProfilerOrException(ProfilerFactory.java:37) + at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:225) + ... 2 more + +MultiDim on  main [!] via ☕ v20.0.1 +❯ sudo java -Djmh.blackhole.mode=COMPILER -cp target/benchmark.jar com.github.shautvast.benchmarks.loops.LoopBenchmark +Password: +The operation couldn’t be completed. Unable to locate a Java Runtime. +Please visit http://www.java.com for information on installing Java. + + +MultiDim on  main [!] via ☕ v20.0.1 took 9s +❯ sudo +usage: sudo -h | -K | -k | -V +usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] +usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] +usage: sudo [-AbEHknPS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s] [] +usage: sudo -e [-AknS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ... + +MultiDim on  main [!] via ☕ v20.0.1 +❯ sudo su - +192:~ root# java +The operation couldn’t be completed. Unable to locate a Java Runtime. +Please visit http://www.java.com for information on installing Java. + +192:~ root# ~Shautvast/ +.Trash/ .cargo/ .dropbox/ .jmc/ .npm/ .ssh/ .vscode/ Documents/ IdeaSnapshots/ Pictures/ dev/ +.android/ .conda/ .gem/ .local/ .oh-my-zsh/ .swiftpm/ .yjp/ Downloads/ Library/ Public/ env/ +.bundle/ .config/ .gradle/ .m2/ .pnpm-state/ .terminfo/ .zsh_sessions/ Dropbox/ Movies/ Snapshots/ +.cache/ .docker/ .hawtjni/ .mint/ .rustup/ .vim/ Desktop/ IdeaProjects/ Music/ bin/ +192:~ root# ~Shautvast/Library/ +Accessibility/ DataAccess/ KeyboardServices/ Sharing/ +Accounts/ DataDeliveryServices/ Keychains/ Sounds/ +AppleMediaServices/ Developer/ LanguageModeling/ Spelling/ +Application Scripts/ DoNotDisturb/ LaunchAgents/ Staging/ +Application Support/ Dropbox/ Logs/ StatusKit/ +Assistant/ DuetExpertCenter/ Mail/ Suggestions/ +Assistants/ Favorites/ Messages/ SyncedPreferences/ +Audio/ Finance/ Metadata/ Translation/ +Autosave Information/ FontCollections/ Mobile Documents/ Trial/ +Biome/ Fonts/ Passes/ Weather/ +Caches/ FrontBoard/ PersonalizationPortrait/ WebKit/ +Calendars/ GameKit/ Photos/ com.apple.WatchListKit/ +CallServices/ Google/ PreferencePanes/ com.apple.aiml.instrumentation/ +ColorPickers/ Group Containers/ Preferences/ com.apple.appleaccountd/ +Colors/ HTTPStorages/ Printers/ com.apple.bluetooth.services.cloud/ +Compositions/ HomeKit/ Reminders/ com.apple.iTunesCloud/ +Contacts/ IdentityServices/ Safari/ com.apple.icloud.searchpartyd/ +ContainerManager/ Input Methods/ SafariSafeBrowsing/ com.apple.internal.ck/ +Containers/ IntelligencePlatform/ SafariSandboxBroker/ org.swift.swiftpm/ +Cookies/ Internet Plug-Ins/ Saved Application State/ pnpm/ +CoreFollowUp/ Java/ Screen Savers/ studentd/ +DES/ Keyboard/ ScreenRecordings/ +Daemon Containers/ Keyboard Layouts/ Services/ +192:~ root# ~Shautvast/Library/Java/JavaVirtualMachines/ +corretto-18.0.2/ jdk-17.0.7.jdk/ openjdk-19.0.2/ openjdk-20.0.1/ +192:~ root# ~Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/ +-sh: /Users/Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/: is a directory +192:~ root# logout + +MultiDim on  main [!] via ☕ v20.0.1 took 1m +❯ sudo /Users/Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/Contents/Home/bin/java -Djmh.blackhole.mode=COMPILER -cp target/benchmark.jar com.github.shautvast.benchmarks.loops.LoopBenchmark # JMH version: 1.36 # VM version: JDK 20.0.1, OpenJDK 64-Bit Server VM, 20.0.1+9-29 # VM invoker: /Users/Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/Contents/Home/bin/java -# VM options: -Djmh.blackhole.mode=COMPILER -verbose:gc +# VM options: -Djmh.blackhole.mode=COMPILER # Blackhole mode: compiler (forced) # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each @@ -14,29 +151,307 @@ # Run progress: 0,00% complete, ETA 00:06:40 # Fork: 1 of 1 -[0.003s][info][gc] Using G1 -# Warmup Iteration 1: 1754,284 ns/op -# Warmup Iteration 2: 1880,906 ns/op -# Warmup Iteration 3: 1876,949 ns/op -# Warmup Iteration 4: 1878,817 ns/op -# Warmup Iteration 5: 1878,709 ns/op -Iteration 1: 1878,447 ns/op -Iteration 2: 1885,419 ns/op -Iteration 3: 1875,054 ns/op -Iteration 4: 1873,731 ns/op -Iteration 5: 1874,494 ns/op +# Preparing profilers: DTraceAsmProfiler +# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console +# Warmup Iteration 1: 1781,850 ns/op +# Warmup Iteration 2: 1902,993 ns/op +# Warmup Iteration 3: 1889,591 ns/op +# Warmup Iteration 4: 1892,012 ns/op +# Warmup Iteration 5: 1893,306 ns/op +Iteration 1: 1891,110 ns/op +Iteration 2: 1890,956 ns/op +Iteration 3: 1885,661 ns/op +Iteration 4: 1887,144 ns/op +Iteration 5: 1886,112 ns/op +# Processing profiler results: DTraceAsmProfiler Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.cStyle": - 1877,429 ±(99.9%) 18,547 ns/op [Average] - (min, avg, max) = (1873,731, 1877,429, 1885,419), stdev = 4,817 - CI (99.9%): [1858,882, 1895,976] (assumes normal distribution) + 1888,196 ±(99.9%) 10,184 ns/op [Average] + (min, avg, max) = (1885,661, 1888,196, 1891,110), stdev = 2,645 + CI (99.9%): [1878,013, 1898,380] (assumes normal distribution) + +Secondary result "com.github.shautvast.benchmarks.loops.LoopBenchmark.cStyle:·asm": +PrintAssembly processed: 36421 total address lines. +Perf output processed (skipped 51,680 seconds): + Column 1: sampled_pc (48015 events) + +Hottest code regions (>10,00% "sampled_pc" events): + Event counts are percents of total event count. + +....[Hottest Region 1].............................................................................. +c2, level 4, com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub, version 5, compile id 587 + + 0x0000000112765da0: 0f00 a0d2 | 0f66 9df2 + 0x0000000112765da8: ; {metadata('java/lang/String')} + 0x0000000112765da8: 1400 a0d2 | 1466 9df2 + 0x0000000112765db0: ; {metadata('java/lang/String')} + 0x0000000112765db0: 0000 a0d2 | 0066 9df2 + 0x0000000112765db8: ; {metadata('java/util/ArrayList')} + 0x0000000112765db8: 7101 a0d2 | 115e 9bf2 | 3700 0014 | 1f20 03d5 | 1f20 03d5 | 1f20 03d5 + 0,03% 0x0000000112765dd0: ;*lload_2 {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@13 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,03% 0x0000000112765dd0: e203 0a2a | cdc8 228b | ac11 40b9 | 8cf1 7dd3 + 0,03% 0x0000000112765de0: ; implicit exception: dispatches to 0x0000000112765f18 + 0,03% 0x0000000112765de0: 8a09 40b9 | 5f01 0f6b + 23,57% 0x0000000112765de8: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList::elementData@5 (line 411) + ; - java.util.ArrayList::get@11 (line 428) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 23,57% 0x0000000112765de8: ad15 40b9 + 2,50% 0x0000000112765dec: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@25 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 2,50% 0x0000000112765dec: 0112 0054 + 0,20% 0x0000000112765df0: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,20% 0x0000000112765df0: 8a15 40b9 + 0x0000000112765df4: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList::elementData@5 (line 411) + ; - java.util.ArrayList::get@11 (line 428) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765df4: adf1 7dd3 + 0,00% 0x0000000112765df8: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,00% 0x0000000112765df8: 4af1 7dd3 + 0,20% 0x0000000112765dfc: ; implicit exception: dispatches to 0x000000011276605c + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,20% 0x0000000112765dfc: 4a0d 40b9 + 30,39% 0x0000000112765e00: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 30,39% 0x0000000112765e00: 8c41 c039 | 4a29 cc1a + 0,02% 0x0000000112765e08: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@32 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,02% 0x0000000112765e08: 84c0 2a8b | 4d08 00b4 | aa09 40b9 | 5f01 006b + 0,04% 0x0000000112765e18: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@25 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,04% 0x0000000112765e18: 6110 0054 | aa15 40b9 + 0,00% 0x0000000112765e20: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,00% 0x0000000112765e20: 4af1 7dd3 + 0,22% 0x0000000112765e24: ; implicit exception: dispatches to 0x000000011276605c + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,22% 0x0000000112765e24: 4a0d 40b9 + 27,83% 0x0000000112765e28: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 27,83% 0x0000000112765e28: ad41 c039 | 4a29 cd1a + 0,06% 0x0000000112765e30: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@32 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,06% 0x0000000112765e30: 84c0 2a8b + 0x0000000112765e34: ;*iinc {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@34 (line 34) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e34: 4a08 0011 | 5f9d 0f71 + 5,18% 0x0000000112765e3c: ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@10 (line 34) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 5,18% 0x0000000112765e3c: abfc ff54 + 0,27% 0x0000000112765e40: ; ImmutableOopMap {r14=Oop c_rarg1=Oop c_rarg3=Oop c_rarg5=Oop r11=Derived_oop_c_rarg5 c_rarg6=Oop r19=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@37 (line 34) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,27% 0x0000000112765e40: 87c3 41f9 + 0x0000000112765e44: ;*goto {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@37 (line 34) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + ; {poll} + 0x0000000112765e44: ff00 40b9 + 0x0000000112765e48: ;*getfield isDone {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@32 (line 195) + 0x0000000112765e48: 6cfd df08 + 0x0000000112765e4c: ;*lload_2 {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@13 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e4c: 4208 0011 | cac8 228b | 4d11 40b9 + 0x0000000112765e58: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList::elementData@5 (line 411) + ; - java.util.ArrayList::get@11 (line 428) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e58: adf1 7dd3 + 0,04% 0x0000000112765e5c: ; implicit exception: dispatches to 0x000000011276606c + 0,04% 0x0000000112765e5c: aa09 40b9 | 5f01 106b + 0x0000000112765e64: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@25 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e64: 810d 0054 | aa15 40b9 + 0x0000000112765e6c: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e6c: 4af1 7dd3 + 0x0000000112765e70: ; implicit exception: dispatches to 0x000000011276605c + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e70: 4a0d 40b9 + 0,02% 0x0000000112765e74: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,02% 0x0000000112765e74: a741 c039 | 4d29 c71a + 0x0000000112765e7c: ;*iinc {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@34 (line 34) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e7c: 4204 0011 + 0x0000000112765e80: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@32 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765e80: 84c0 2d8b | 5fa0 0f71 + 0x0000000112765e88: ;*getfield isDone {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@32 (line 195) + 0x0000000112765e88: 4bfe ff54 | 8ac3 41f9 + 0x0000000112765e90: ; ImmutableOopMap {r14=Oop c_rarg1=Oop c_rarg3=Oop c_rarg5=Oop r11=Derived_oop_c_rarg5 r19=Oop } + ;*ifeq {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@35 (line 195) + 0x0000000112765e90: bd07 0091 + 0,00% 0x0000000112765e94: ; {poll} + 0,00% 0x0000000112765e94: 5f01 40b9 + 0x0000000112765e98: ;*aload_1 {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@38 (line 196) + 0x0000000112765e98: ec04 0035 | 2c0c 40b9 + 0x0000000112765ea0: ;*getfield list {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@15 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765ea0: 8af1 7dd3 + 0,02% 0x0000000112765ea4: ; implicit exception: dispatches to 0x0000000112765f94 + 0,02% 0x0000000112765ea4: 4c09 40b9 | 9f01 116b + 0x0000000112765eac: ;*invokeinterface get {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765eac: 4107 0054 | 4c15 40b9 + 0x0000000112765eb4: ;*getfield elementData {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList::elementData@1 (line 411) + ; - java.util.ArrayList::get@11 (line 428) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765eb4: 86f1 7dd3 + 0,00% 0x0000000112765eb8: ;*getfield size {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList::get@2 (line 427) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0,00% 0x0000000112765eb8: 4c11 40b9 + 0x0000000112765ebc: ;*invokestatic checkIndex {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Objects::checkIndex@3 (line 385) + ; - java.util.ArrayList::get@5 (line 427) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765ebc: cc06 f837 | ac06 0034 | 9f9d 0f71 | 6906 0054 + 0,01% 0x0000000112765ecc: ; implicit exception: dispatches to 0x0000000112765f94 + 0,01% 0x0000000112765ecc: cc0c 40b9 | 9f01 0071 | 0906 0054 | 9f9d 0f71 | c905 0054 | ca10 40b9 + 0x0000000112765ee4: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList::elementData@5 (line 411) + ; - java.util.ArrayList::get@11 (line 428) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@20 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765ee4: 4df1 7dd3 + 0,01% 0x0000000112765ee8: ; implicit exception: dispatches to 0x000000011276607c + 0,01% 0x0000000112765ee8: ac09 40b9 | 9f01 146b + 0x0000000112765ef0: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@25 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765ef0: 210a 0054 | ac15 40b9 + 0x0000000112765ef8: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::cStyle@28 (line 35) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub@19 (line 193) + 0x0000000112765ef8: 8af1 7dd3 +.................................................................................................... + 99,88% + +....[Hottest Regions]............................................................................... + 99,88% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub, version 5, compile id 587 + 0,01% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,01% libsystem_kernel.dylib thread_self_trap + 0,01% libsystem_kernel.dylib write + 0,00% libjvm.dylib PlatformMonitor::wait(long) + 0,00% libjvm.dylib defaultStream::write(char const*, unsigned long) + 0,00% libjvm.dylib VMThread::wait_for_operation() + 0,00% libsystem_kernel.dylib mach_absolute_time + 0,00% libsystem_platform.dylib _platform_memmove + 0,00% libjvm.dylib Node::pinned() const + 0,00% libjvm.dylib NullCheckEliminator::iterate_one(BlockBegin*) + 0,00% libjvm.dylib VM_Operation::name() const + 0,00% libjvm.dylib CompiledStaticCall::compute_entry(methodHandle const&, bool, StaticCallInfo&) + 0,00% libjvm.dylib java_lang_ClassLoader::non_reflection_class_loader(oopDesc*) + 0,00% libjvm.dylib Matcher::find_shared_visit(Matcher::MStack&, Node*, unsigned int, bool&, int&) + 0,00% libjvm.dylib defaultStream::has_log_file() + 0,00% libjvm.dylib defaultStream::write(char const*, unsigned long) + 0,00% libjvm.dylib PerfLongVariant::sample() + 0,00% libjvm.dylib RegMask::is_bound(unsigned int) const + 0,00% libjvm.dylib StatSamplerTask::task() + 0,04% <...other 20 warm regions...> +.................................................................................................... + 100,00% + +....[Hottest Methods (after inlining)].............................................................. + 99,88% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_cStyle_jmhTest::cStyle_avgt_jmhStub, version 5, compile id 587 + 0,01% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,01% libsystem_kernel.dylib write + 0,01% libsystem_kernel.dylib thread_self_trap + 0,01% libjvm.dylib defaultStream::write(char const*, unsigned long) + 0,00% libjvm.dylib PlatformMonitor::wait(long) + 0,00% libsystem_platform.dylib _platform_memmove + 0,00% c2, level 4 sun.security.provider.SHA::implCompress0, version 6, compile id 594 + 0,00% libjvm.dylib VMThread::wait_for_operation() + 0,00% libsystem_kernel.dylib mach_absolute_time + 0,00% libjvm.dylib TypeInt::eq(Type const*) const + 0,00% libjvm.dylib defaultStream::has_log_file() + 0,00% libsystem_kernel.dylib __commpage_gettimeofday_internal + 0,00% libjvm.dylib DYLD-STUB$$memcpy + 0,00% libjvm.dylib PerfLongVariant::sample() + 0,00% libjvm.dylib Matcher::find_shared_visit(Matcher::MStack&, Node*, unsigned int, bool&, int&) + 0,00% libjvm.dylib RegMask::is_bound(unsigned int) const + 0,00% libjvm.dylib Node::pinned() const + 0,00% interpreter nofast_aload_0 236 nofast_aload_0 + 0,00% libsystem_c.dylib __vfprintf + 0,04% <...other 18 warm methods...> +.................................................................................................... + 100,00% + +....[Distribution by Source]........................................................................ + 99,89% c2, level 4 + 0,05% libjvm.dylib + 0,04% libsystem_kernel.dylib + 0,01% libsystem_c.dylib + 0,01% libsystem_platform.dylib + 0,01% interpreter + 0,00% 0x1121b1418 +.................................................................................................... + 100,00% + # JMH version: 1.36 # VM version: JDK 20.0.1, OpenJDK 64-Bit Server VM, 20.0.1+9-29 # VM invoker: /Users/Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/Contents/Home/bin/java -# VM options: -Djmh.blackhole.mode=COMPILER -verbose:gc +# VM options: -Djmh.blackhole.mode=COMPILER # Blackhole mode: compiler (forced) # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each @@ -45,31 +460,222 @@ Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.cStyle": # Benchmark mode: Average time, time/op # Benchmark: com.github.shautvast.benchmarks.loops.LoopBenchmark.enhancedForLoop -# Run progress: 25,00% complete, ETA 00:05:00 +# Run progress: 25,00% complete, ETA 00:05:06 # Fork: 1 of 1 -[0.003s][info][gc] Using G1 -# Warmup Iteration 1: 1756,742 ns/op -# Warmup Iteration 2: 3557,042 ns/op -# Warmup Iteration 3: 5425,266 ns/op -# Warmup Iteration 4: 7101,989 ns/op -# Warmup Iteration 5: 8871,875 ns/op -Iteration 1: 10636,875 ns/op -Iteration 2: 12417,359 ns/op -Iteration 3: 14469,683 ns/op -Iteration 4: 16248,110 ns/op -Iteration 5: 17946,403 ns/op +# Preparing profilers: DTraceAsmProfiler +# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console +# Warmup Iteration 1: 1789,423 ns/op +# Warmup Iteration 2: 3670,283 ns/op +# Warmup Iteration 3: 5378,372 ns/op +# Warmup Iteration 4: 7143,560 ns/op +# Warmup Iteration 5: 8947,415 ns/op +Iteration 1: 10754,271 ns/op +Iteration 2: 12523,531 ns/op +Iteration 3: 14408,435 ns/op +Iteration 4: 16234,401 ns/op +Iteration 5: 17981,781 ns/op +# Processing profiler results: DTraceAsmProfiler Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.enhancedForLoop": - 14343,686 ±(99.9%) 11238,581 ns/op [Average] - (min, avg, max) = (10636,875, 14343,686, 17946,403), stdev = 2918,624 - CI (99.9%): [3105,105, 25582,267] (assumes normal distribution) + 14380,484 ±(99.9%) 11060,940 ns/op [Average] + (min, avg, max) = (10754,271, 14380,484, 17981,781), stdev = 2872,491 + CI (99.9%): [3319,544, 25441,424] (assumes normal distribution) + +Secondary result "com.github.shautvast.benchmarks.loops.LoopBenchmark.enhancedForLoop:·asm": +PrintAssembly processed: 36321 total address lines. +Perf output processed (skipped 51,575 seconds): + Column 1: sampled_pc (49973 events) + +Hottest code regions (>10,00% "sampled_pc" events): + Event counts are percents of total event count. + +....[Hottest Region 1].............................................................................. +c2, level 4, com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub, version 5, compile id 574 + + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a6e8: 4604 0011 + 0x0000000113e5a6ec: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@42 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a6ec: 63c0 218b | df00 0b6b + 0x0000000113e5a6f4: ;*ifeq {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@20 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a6f4: 8a00 0054 | ed03 022a | e203 062a | ebff ff17 | bf02 16eb | a1c3 851a | 2b04 0051 | 3f00 0b6b + 0x0000000113e5a714: e103 0132 | 2bb0 8b1a | df00 0b6b + 0x0000000113e5a720: ;*goto {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@44 (line 54) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a720: 6a07 0054 | 4204 0011 | 2600 0014 | 1f20 03d5 + 1,45% 0x0000000113e5a730: ;*aload {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@23 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 1,45% 0x0000000113e5a730: e203 062a | e6c8 228b | c110 40b9 | 35f0 7dd3 + 0,88% 0x0000000113e5a740: ; implicit exception: dispatches to 0x0000000113e5a7e0 + 0,88% 0x0000000113e5a740: a10a 40b9 | 3f00 0f6b + 29,09% 0x0000000113e5a748: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList$Itr::next@64 (line 975) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@25 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 29,09% 0x0000000113e5a748: c614 40b9 + 0x0000000113e5a74c: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@30 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a74c: 4122 0054 + 2,42% 0x0000000113e5a750: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 2,42% 0x0000000113e5a750: a116 40b9 + 0,10% 0x0000000113e5a754: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList$Itr::next@64 (line 975) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@25 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0,10% 0x0000000113e5a754: d4f0 7dd3 + 0,56% 0x0000000113e5a758: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0,56% 0x0000000113e5a758: 21f0 7dd3 + 0,26% 0x0000000113e5a75c: ; implicit exception: dispatches to 0x0000000113e5abd4 + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0,26% 0x0000000113e5a75c: 210c 40b9 + 23,18% 0x0000000113e5a760: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 23,18% 0x0000000113e5a760: a642 c039 | 2128 c61a + 2,36% 0x0000000113e5a768: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@42 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 2,36% 0x0000000113e5a768: 63c0 218b | 9403 00b4 | 810a 40b9 | 3f00 0e6b + 2,32% 0x0000000113e5a778: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@30 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 2,32% 0x0000000113e5a778: a120 0054 | 8116 40b9 + 0,00% 0x0000000113e5a780: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0,00% 0x0000000113e5a780: 21f0 7dd3 + 1,81% 0x0000000113e5a784: ; implicit exception: dispatches to 0x0000000113e5abd4 + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 1,81% 0x0000000113e5a784: 210c 40b9 + 17,19% 0x0000000113e5a788: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@38 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 17,19% 0x0000000113e5a788: 8642 c039 | 2128 c61a + 0,01% 0x0000000113e5a790: ;*iadd {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList$Itr::next@53 (line 974) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@25 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0,01% 0x0000000113e5a790: 4608 0011 + 0,39% 0x0000000113e5a794: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@42 (line 53) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0,39% 0x0000000113e5a794: 63c0 218b | df00 0d6b + 0x0000000113e5a79c: ;*ifeq {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@20 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a79c: abfc ff54 | e103 022a | 94c3 41f9 | 2d08 0011 + 0x0000000113e5a7ac: ; ImmutableOopMap {r12=Oop r17=Oop c_rarg4=Oop c_rarg7=Oop r23=Oop rlocals=Oop r25=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@44 (line 54) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a7ac: 2104 0011 + 0,03% 0x0000000113e5a7b0: ;*goto {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@44 (line 54) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + ; {poll} + 0,03% 0x0000000113e5a7b0: 9f02 40b9 | df00 0b6b | 8a02 0054 + 0x0000000113e5a7bc: ;*aload {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@23 (line 52) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub@19 (line 193) + 0x0000000113e5a7bc: e203 062a | 7f01 026b | 6101 024b | e1b3 811a | 3f40 1f71 | 6183 811a | 2d00 020b | d7ff ff17 + 0x0000000113e5a7dc: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::enhancedForLoop@30 (line 52) +.................................................................................................... + 99,80% + +....[Hottest Regions]............................................................................... + 99,80% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub, version 5, compile id 574 + 0,05% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub, version 5, compile id 574 + 0,02% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,01% libsystem_kernel.dylib thread_self_trap + 0,01% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub, version 5, compile id 574 + 0,01% libsystem_kernel.dylib write + 0,01% libsystem_kernel.dylib __psynch_cvwait + 0,00% libjvm.dylib fileStream::write(char const*, unsigned long) + 0,00% libjvm.dylib defaultStream::has_log_file() + 0,00% libjvm.dylib xmlStream::write_text(char const*, unsigned long) + 0,00% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub, version 5, compile id 574 + 0,00% libsystem_kernel.dylib __error + 0,00% libsystem_platform.dylib _platform_memmove + 0,00% libjvm.dylib Klass::is_klass() const + 0,00% libjvm.dylib LIR_Assembler::const2reg(LIR_Opr, LIR_Opr, LIR_PatchCode, CodeEmitInfo*) + 0,00% libjvm.dylib LinearScanWalker::alloc_free_reg(Interval*) + 0,00% libjvm.dylib NullCheckEliminator::visit(Instruction**) + 0,00% libjvm.dylib PhaseChaitin::Select() + 0,00% libjvm.dylib ConstantPool::impl_name_ref_at(int, bool) + 0,00% libjvm.dylib PhaseChaitin::add_input_to_liveout(Block*, Node*, IndexSet*, double, PhaseChaitin::Pressure&, PhaseChaitin::Pressure&) + 0,05% <...other 26 warm regions...> +.................................................................................................... + 100,00% + +....[Hottest Methods (after inlining)].............................................................. + 99,87% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_enhancedForLoop_jmhTest::enhancedForLoop_avgt_jmhStub, version 5, compile id 574 + 0,02% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,01% libsystem_kernel.dylib thread_self_trap + 0,01% libsystem_kernel.dylib write + 0,01% + 0,01% libsystem_kernel.dylib __psynch_cvwait + 0,00% libjvm.dylib defaultStream::has_log_file() + 0,00% libjvm.dylib fileStream::write(char const*, unsigned long) + 0,00% libsystem_c.dylib __vfprintf + 0,00% libsystem_platform.dylib _platform_memmove + 0,00% libsystem_kernel.dylib __error + 0,00% libjvm.dylib xmlStream::write_text(char const*, unsigned long) + 0,00% libsystem_c.dylib __v2printf + 0,00% libjvm.dylib PhaseChaitin::add_input_to_liveout(Block*, Node*, IndexSet*, double, PhaseChaitin::Pressure&, PhaseChaitin::Pressure&) + 0,00% libjvm.dylib NullCheckEliminator::visit(Instruction**) + 0,00% libjvm.dylib TypeOopPtr::eq(Type const*) const + 0,00% libjvm.dylib Node::is_dead_loop_safe() const + 0,00% libjvm.dylib PhaseIterGVN::add_users_to_worklist(Node*) + 0,00% libjvm.dylib defaultStream::hold(long) + 0,00% libjvm.dylib ConstantPool::impl_name_ref_at(int, bool) + 0,04% <...other 18 warm methods...> +.................................................................................................... + 100,00% + +....[Distribution by Source]........................................................................ + 99,87% c2, level 4 + 0,05% libsystem_kernel.dylib + 0,04% libjvm.dylib + 0,01% libsystem_c.dylib + 0,01% + 0,00% libsystem_pthread.dylib + 0,00% libsystem_platform.dylib + 0,00% dyld + 0,00% interpreter +.................................................................................................... + 100,00% + # JMH version: 1.36 # VM version: JDK 20.0.1, OpenJDK 64-Bit Server VM, 20.0.1+9-29 # VM invoker: /Users/Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/Contents/Home/bin/java -# VM options: -Djmh.blackhole.mode=COMPILER -verbose:gc +# VM options: -Djmh.blackhole.mode=COMPILER # Blackhole mode: compiler (forced) # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each @@ -78,31 +684,219 @@ Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.enhancedForLoop": # Benchmark mode: Average time, time/op # Benchmark: com.github.shautvast.benchmarks.loops.LoopBenchmark.iterator -# Run progress: 50,00% complete, ETA 00:03:20 +# Run progress: 50,00% complete, ETA 00:03:24 # Fork: 1 of 1 -[0.003s][info][gc] Using G1 -# Warmup Iteration 1: 1761,563 ns/op -# Warmup Iteration 2: 3563,533 ns/op -# Warmup Iteration 3: 5422,159 ns/op -# Warmup Iteration 4: 7090,576 ns/op -# Warmup Iteration 5: 8872,802 ns/op -Iteration 1: 10809,548 ns/op -Iteration 2: 12595,235 ns/op -Iteration 3: 14456,839 ns/op -Iteration 4: 16226,710 ns/op -Iteration 5: 18015,564 ns/op +# Preparing profilers: DTraceAsmProfiler +# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console +# Warmup Iteration 1: 1788,035 ns/op +# Warmup Iteration 2: 3623,369 ns/op +# Warmup Iteration 3: 5376,288 ns/op +# Warmup Iteration 4: 7166,902 ns/op +# Warmup Iteration 5: 8969,890 ns/op +Iteration 1: 10749,562 ns/op +Iteration 2: 12534,690 ns/op +Iteration 3: 14450,599 ns/op +Iteration 4: 16235,645 ns/op +Iteration 5: 18026,621 ns/op +# Processing profiler results: DTraceAsmProfiler Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.iterator": - 14420,779 ±(99.9%) 10985,942 ns/op [Average] - (min, avg, max) = (10809,548, 14420,779, 18015,564), stdev = 2853,014 - CI (99.9%): [3434,837, 25406,721] (assumes normal distribution) + 14399,423 ±(99.9%) 11115,231 ns/op [Average] + (min, avg, max) = (10749,562, 14399,423, 18026,621), stdev = 2886,590 + CI (99.9%): [3284,192, 25514,654] (assumes normal distribution) + +Secondary result "com.github.shautvast.benchmarks.loops.LoopBenchmark.iterator:·asm": +PrintAssembly processed: 37776 total address lines. +Perf output processed (skipped 51,743 seconds): + Column 1: sampled_pc (49971 events) + +Hottest code regions (>10,00% "sampled_pc" events): + Event counts are percents of total event count. + +....[Hottest Region 1].............................................................................. +c2, level 4, com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub, version 5, compile id 585 + + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d100: 84c0 218b | ff00 0d6b + 0x000000013840d108: ;*ifeq {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@20 (line 43) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d108: 8a00 0054 | f003 032a | e303 072a | ebff ff17 | df02 17eb | a1c0 911a | 2d04 0051 | 3f00 0d6b + 0x000000013840d128: e103 0132 | 2db0 8d1a | ff00 0d6b + 0x000000013840d134: ;*goto {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@40 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d134: 4a07 0054 | 6304 0011 | 2500 0014 + 1,54% 0x000000013840d140: ;*lload_2 {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@23 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 1,54% 0x000000013840d140: e303 072a | 87ca 238b | e110 40b9 | 36f0 7dd3 + 1,08% 0x000000013840d150: ; implicit exception: dispatches to 0x000000013840d1f0 + 1,08% 0x000000013840d150: c10a 40b9 | 3f00 0b6b + 30,38% 0x000000013840d158: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList$Itr::next@64 (line 975) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@26 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 30,38% 0x000000013840d158: e714 40b9 + 0x000000013840d15c: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@31 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d15c: a120 0054 + 2,55% 0x000000013840d160: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 2,55% 0x000000013840d160: c116 40b9 + 0,23% 0x000000013840d164: ;*aaload {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList$Itr::next@64 (line 975) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@26 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0,23% 0x000000013840d164: f5f0 7dd3 + 0,31% 0x000000013840d168: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0,31% 0x000000013840d168: 21f0 7dd3 + 0,24% 0x000000013840d16c: ; implicit exception: dispatches to 0x000000013840d608 + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0,24% 0x000000013840d16c: 210c 40b9 + 22,37% 0x000000013840d170: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 22,37% 0x000000013840d170: c742 c039 | 2128 c71a + 1,57% 0x000000013840d178: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@38 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 1,57% 0x000000013840d178: 84c0 218b | 9503 00b4 | a10a 40b9 | 3f00 0a6b + 1,61% 0x000000013840d188: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@31 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 1,61% 0x000000013840d188: 011f 0054 | a116 40b9 + 0,00% 0x000000013840d190: ;*getfield value {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@1 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0,00% 0x000000013840d190: 21f0 7dd3 + 1,33% 0x000000013840d194: ; implicit exception: dispatches to 0x000000013840d608 + ;*arraylength {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::length@4 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 1,33% 0x000000013840d194: 210c 40b9 + 17,53% 0x000000013840d198: ;*getfield coder {reexecute=0 rethrow=0 return_oop=0} + ; - java.lang.String::coder@7 (line 4556) + ; - java.lang.String::length@6 (line 1499) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@34 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 17,53% 0x000000013840d198: a742 c039 | 2128 c71a + 0,02% 0x000000013840d1a0: ;*iadd {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.ArrayList$Itr::next@53 (line 974) + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@26 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0,02% 0x000000013840d1a0: 6708 0011 + 1,00% 0x000000013840d1a4: ;*ladd {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@38 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 1,00% 0x000000013840d1a4: 84c0 218b | ff00 106b + 0x000000013840d1ac: ;*ifeq {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@20 (line 43) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d1ac: abfc ff54 | e103 032a | 95c3 41f9 | 3008 0011 + 0x000000013840d1bc: ; ImmutableOopMap {r15=Oop c_rarg0=Oop c_rarg6=Oop resp=Oop rlocals=Oop r25=Oop rcpool=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@40 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d1bc: 2104 0011 + 0,03% 0x000000013840d1c0: ;*goto {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@40 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + ; {poll} + 0,03% 0x000000013840d1c0: bf02 40b9 | ff00 0d6b | 8a02 0054 + 0x000000013840d1cc: ;*lload_2 {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@23 (line 44) + ; - com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub@19 (line 193) + 0x000000013840d1cc: e303 072a | bf01 036b | a101 034b | e1b3 811a | 3f40 1f71 | 6183 811a | 3000 030b | d7ff ff17 + 0x000000013840d1ec: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - com.github.shautvast.benchmarks.loops.LoopBenchmark::iterator@31 (line 44) +.................................................................................................... + 99,83% + +....[Hottest Regions]............................................................................... + 99,83% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub, version 5, compile id 585 + 0,03% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub, version 5, compile id 585 + 0,01% libsystem_kernel.dylib thread_self_trap + 0,01% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub, version 5, compile id 585 + 0,01% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,00% libjvm.dylib xmlStream::write_text(char const*, unsigned long) + 0,00% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub, version 5, compile id 585 + 0,00% libsystem_kernel.dylib write + 0,00% libsystem_kernel.dylib __write_nocancel + 0,00% libdyld.dylib tlv_get_addr + 0,00% libjvm.dylib Node::is_CFG() const + 0,00% libjvm.dylib UniverseOper::opcode() const + 0,00% libjvm.dylib LinearScan::allocate_registers() + 0,00% libjvm.dylib URShiftLNode::Opcode() const + 0,00% libjvm.dylib RegionNode::pinned() const + 0,00% libjvm.dylib CodeBlob::flush() + 0,00% libjvm.dylib CodeCache::find_blob(void*) + 0,00% libjvm.dylib ConstantPool::impl_name_ref_at(int, bool) + 0,00% libjvm.dylib ConstantPool::impl_tag_ref_at(int, bool) + 0,00% libjvm.dylib DIR_Chunk* GrowableArrayWithAllocator>::insert_sorted<&DIR_Chunk::compare(DIR_Chunk* const&, DIR_Chunk* const&)>(DIR_Chunk* const&) + 0,06% <...other 30 warm regions...> +.................................................................................................... + 100,00% + +....[Hottest Methods (after inlining)].............................................................. + 99,88% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_iterator_jmhTest::iterator_avgt_jmhStub, version 5, compile id 585 + 0,01% libsystem_kernel.dylib thread_self_trap + 0,01% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,01% + 0,00% libsystem_kernel.dylib write + 0,00% libsystem_c.dylib __vfprintf + 0,00% libsystem_kernel.dylib __write_nocancel + 0,00% libdyld.dylib tlv_get_addr + 0,00% libjvm.dylib xmlStream::write_text(char const*, unsigned long) + 0,00% libjvm.dylib ConnectionGraph::compute_escape() + 0,00% libsystem_platform.dylib flsl + 0,00% libjvm.dylib ValueRecorder::maybe_find_index(Metadata*) + 0,00% libjvm.dylib CodeBlob::flush() + 0,00% libjvm.dylib PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&) + 0,00% libjvm.dylib CodeCache::find_blob(void*) + 0,00% libjvm.dylib ConstantPool::impl_name_ref_at(int, bool) + 0,00% libsystem_pthread.dylib pthread_mutex_unlock + 0,00% libjvm.dylib fileStream::write(char const*, unsigned long) + 0,00% libjvm.dylib defaultStream::write(char const*, unsigned long) + 0,00% libjvm.dylib PhaseCCP::transform_once(Node*) + 0,04% <...other 22 warm methods...> +.................................................................................................... + 100,00% + +....[Distribution by Source]........................................................................ + 99,88% c2, level 4 + 0,06% libjvm.dylib + 0,03% libsystem_kernel.dylib + 0,01% + 0,01% libsystem_platform.dylib + 0,00% libsystem_pthread.dylib + 0,00% libdyld.dylib + 0,00% libsystem_c.dylib + 0,00% c1, level 3 + 0,00% interpreter +.................................................................................................... + 100,00% + # JMH version: 1.36 # VM version: JDK 20.0.1, OpenJDK 64-Bit Server VM, 20.0.1+9-29 # VM invoker: /Users/Shautvast/Library/Java/JavaVirtualMachines/openjdk-20.0.1/Contents/Home/bin/java -# VM options: -Djmh.blackhole.mode=COMPILER -verbose:gc +# VM options: -Djmh.blackhole.mode=COMPILER # Blackhole mode: compiler (forced) # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each @@ -111,51 +905,298 @@ Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.iterator": # Benchmark mode: Average time, time/op # Benchmark: com.github.shautvast.benchmarks.loops.LoopBenchmark.stream -# Run progress: 75,00% complete, ETA 00:01:40 +# Run progress: 75,00% complete, ETA 00:01:42 # Fork: 1 of 1 -[0.003s][info][gc] Using G1 -# Warmup Iteration 1: [0.262s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 27M->5M(520M) 1.402ms -[0.403s][info][gc] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 45M->5M(520M) 0.968ms -[1.547s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.898ms -[2.638s][info][gc] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.976ms -[3.697s][info][gc] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.873ms -[4.757s][info][gc] GC(5) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.908ms -[5.820s][info][gc] GC(6) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.862ms -[6.886s][info][gc] GC(7) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.891ms -[7.941s][info][gc] GC(8) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.886ms -[9.006s][info][gc] GC(9) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.859ms -[10.064s][info][gc] GC(10) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.891ms -690,839 ns/op -# Warmup Iteration 2: [13.586s][info][gc] GC(11) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.895ms -[16.410s][info][gc] GC(12) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.920ms -[19.179s][info][gc] GC(13) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.953ms -2476,292 ns/op -# Warmup Iteration 3: [23.479s][info][gc] GC(14) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 1.045ms -[28.118s][info][gc] GC(15) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 1.149ms -3834,642 ns/op -# Warmup Iteration 4: [33.560s][info][gc] GC(16) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.554ms -[39.269s][info][gc] GC(17) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.602ms -4859,494 ns/op -# Warmup Iteration 5: [46.829s][info][gc] GC(18) Pause Young (Normal) (G1 Evacuation Pause) 305M->5M(520M) 0.605ms -6219,711 ns/op -Iteration 1: [55.043s][info][gc] GC(19) Pause Young (Normal) (G1 Evacuation Pause) 305M->6M(520M) 0.601ms -7151,609 ns/op -Iteration 2: [64.223s][info][gc] GC(20) Pause Young (Normal) (G1 Evacuation Pause) 306M->6M(520M) 0.641ms -8273,040 ns/op -Iteration 3: [74.942s][info][gc] GC(21) Pause Young (Normal) (G1 Evacuation Pause) 306M->6M(520M) 0.580ms -9447,701 ns/op -Iteration 4: [87.347s][info][gc] GC(22) Pause Young (Normal) (G1 Evacuation Pause) 306M->6M(520M) 0.617ms -10760,223 ns/op -Iteration 5: 12082,030 ns/op +# Preparing profilers: DTraceAsmProfiler +# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console +# Warmup Iteration 1: 706,956 ns/op +# Warmup Iteration 2: 2417,531 ns/op +# Warmup Iteration 3: 3942,159 ns/op +# Warmup Iteration 4: 5013,697 ns/op +# Warmup Iteration 5: 5879,023 ns/op +Iteration 1: 7374,025 ns/op +Iteration 2: 8506,645 ns/op +Iteration 3: 9751,840 ns/op +Iteration 4: 11149,152 ns/op +Iteration 5: 11618,932 ns/op +# Processing profiler results: DTraceAsmProfiler Result "com.github.shautvast.benchmarks.loops.LoopBenchmark.stream": - 9542,921 ±(99.9%) 7523,289 ns/op [Average] - (min, avg, max) = (7151,609, 9542,921, 12082,030), stdev = 1953,774 - CI (99.9%): [2019,632, 17066,210] (assumes normal distribution) + 9680,119 ±(99.9%) 6838,907 ns/op [Average] + (min, avg, max) = (7374,025, 9680,119, 11618,932), stdev = 1776,043 + CI (99.9%): [2841,211, 16519,026] (assumes normal distribution) + +Secondary result "com.github.shautvast.benchmarks.loops.LoopBenchmark.stream:·asm": +PrintAssembly processed: 40611 total address lines. +Perf output processed (skipped 51,633 seconds): + Column 1: sampled_pc (49949 events) + +Hottest code regions (>10,00% "sampled_pc" events): + Event counts are percents of total event count. + +....[Hottest Region 1].............................................................................. +c2, level 4, java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487c5c: c600 0c0b | abc8 2c8b | 6111 40b9 + 0,00% 0x0000000116487c68: ;*invokeinterface begin {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::begin@5 (line 253) + ; - java.util.stream.AbstractPipeline::copyInto@-1 (line 505) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,00% 0x0000000116487c68: 27f0 7dd3 + 0,10% 0x0000000116487c6c: ; implicit exception: dispatches to 0x0000000116488870 + 0,10% 0x0000000116487c6c: e108 40b9 + 0x0000000116487c70: ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487c70: 3f00 046b + 26,39% 0x0000000116487c74: ;*ifle {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.AbstractPipeline::wrapSink@11 (line 546) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@9 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 26,39% 0x0000000116487c74: 6b15 40b9 | c158 0054 + 0,09% 0x0000000116487c7c: ;*invokeinterface begin {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::begin@5 (line 253) + ; - java.util.stream.AbstractPipeline::copyInto@-1 (line 505) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,09% 0x0000000116487c7c: e114 40b9 + 0,00% 0x0000000116487c80: ;*invokeinterface evaluateSequential {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,00% 0x0000000116487c80: 6df1 7dd3 | 2bf0 7dd3 + 0,18% 0x0000000116487c88: ; implicit exception: dispatches to 0x00000001164887e8 + ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,18% 0x0000000116487c88: 6b0d 40b9 + 0,60% 0x0000000116487c8c: ;*invokeinterface begin {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::begin@5 (line 253) + ; - java.util.stream.AbstractPipeline::copyInto@-1 (line 505) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,60% 0x0000000116487c8c: e140 c039 + 0x0000000116487c90: ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487c90: 6129 c11a + 0x0000000116487c94: ;*invokeinterface begin {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::begin@5 (line 253) + ; - java.util.stream.AbstractPipeline::copyInto@-1 (line 505) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487c94: d6c2 218b + 0x0000000116487c98: ;*synchronization entry + ; - java.util.stream.AbstractPipeline::copyInto@-1 (line 505) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487c98: 8705 0011 + 1,35% 0x0000000116487c9c: ;*invokeinterface begin {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::begin@5 (line 253) + ; - java.util.stream.AbstractPipeline::copyInto@-1 (line 505) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 1,35% 0x0000000116487c9c: b60a 00f9 + 37,27% 0x0000000116487ca0: ; implicit exception: dispatches to 0x0000000116488874 + 37,27% 0x0000000116487ca0: a109 40b9 + 1,45% 0x0000000116487ca4: ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 1,45% 0x0000000116487ca4: 3f00 036b + 1,29% 0x0000000116487ca8: ;*checkcast {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::<init>@9 (line 248) + ; - java.util.stream.ReferencePipeline$5$1::<init>@7 (line 228) + ; - java.util.stream.ReferencePipeline$5::opWrapSink@6 (line 228) + ; - java.util.stream.AbstractPipeline::wrapSink@-1 (line 544) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@9 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 1,29% 0x0000000116487ca8: c157 0054 + 0,07% 0x0000000116487cac: ;*putfield downstream {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.Sink$ChainedReference::<init>@12 (line 248) + ; - java.util.stream.ReferencePipeline$5$1::<init>@7 (line 228) + ; - java.util.stream.ReferencePipeline$5::opWrapSink@6 (line 228) + ; - java.util.stream.AbstractPipeline::wrapSink@-1 (line 544) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@9 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,07% 0x0000000116487cac: a115 40b9 + 0,00% 0x0000000116487cb0: ;*invokespecial <init> {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.ReferencePipeline$5$1::<init>@7 (line 228) + ; - java.util.stream.ReferencePipeline$5::opWrapSink@6 (line 228) + ; - java.util.stream.AbstractPipeline::wrapSink@-1 (line 544) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@9 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,00% 0x0000000116487cb0: 2bf0 7dd3 + 0,16% 0x0000000116487cb4: ; implicit exception: dispatches to 0x00000001164887e8 + ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,16% 0x0000000116487cb4: 610d 40b9 + 0,03% 0x0000000116487cb8: ;*ifnonnull {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.Objects::requireNonNull@1 (line 232) + ; - java.util.stream.Sink$ChainedReference::<init>@6 (line 248) + ; - java.util.stream.ReferencePipeline$3$1::<init>@7 (line 194) + ; - java.util.stream.ReferencePipeline$3::opWrapSink@6 (line 194) + ; - java.util.stream.AbstractPipeline::wrapSink@23 (line 547) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@9 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,03% 0x0000000116487cb8: ab41 c039 + 0,00% 0x0000000116487cbc: ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,00% 0x0000000116487cbc: 2d28 cb1a + 0,00% 0x0000000116487cc0: ;*invokespecial <init> {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.ReduceOps$10::makeSink@12 (line 491) + ; - java.util.stream.ReduceOps$10::makeSink@1 (line 488) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@2 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,00% 0x0000000116487cc0: d6c2 2d8b + 0,00% 0x0000000116487cc4: ;*synchronization entry + ; - java.util.stream.ReduceOps$3::getOpFlags@-1 (line 185) + ; - java.util.stream.AbstractPipeline::evaluate@80 (line 234) + 0,00% 0x0000000116487cc4: 8c09 0011 + 26,98% 0x0000000116487cc8: ;*getfield sourceStage {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.AbstractPipeline::sourceSpliterator@3 (line 400) + ; - java.util.stream.AbstractPipeline::evaluate@85 (line 234) + 26,98% 0x0000000116487cc8: b60a 00f9 | 9f01 066b + 1,30% 0x0000000116487cd0: ;*new {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.ReduceOps$10::makeSink@0 (line 491) + ; - java.util.stream.ReduceOps$10::makeSink@1 (line 488) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@2 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 1,30% 0x0000000116487cd0: 8bfc ff54 + 0,18% 0x0000000116487cd4: ; ImmutableOopMap {r10=Oop r14=Oop c_rarg2=Oop c_rarg5=Oop r19=Oop resp=Oop rdispatch=Oop rfp=Oop } + ;*goto {reexecute=1 rethrow=0 return_oop=0} + ; - (reexecute) java.util.ArrayList$ArrayListSpliterator::forEachRemaining@103 (line 1623) + ; - java.util.stream.AbstractPipeline::copyInto@32 (line 509) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0,18% 0x0000000116487cd4: 8bc3 41f9 + 0,03% 0x0000000116487cd8: ; {poll} + 0,03% 0x0000000116487cd8: 7f01 40b9 | 9f01 106b | 4bfb ff54 | 9f01 006b | 6a02 0054 + 0x0000000116487cec: ; {metadata('java/lang/String')} + 0x0000000116487cec: 0b00 a0d2 | 0b66 9df2 + 0x0000000116487cf4: ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487cf4: adc8 2c8b | af11 40b9 + 0x0000000116487cfc: ;*invokeinterface get {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.ReduceOps$3ReducingSink::begin@5 (line 164) + ; - java.util.stream.Sink$ChainedReference::begin@5 (line 253) + ; - java.util.stream.AbstractPipeline::copyInto@25 (line 508) + ; - java.util.stream.AbstractPipeline::wrapAndCopyInto@13 (line 499) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@6 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487cfc: edf1 7dd3 + 0,00% 0x0000000116487d00: ; implicit exception: dispatches to 0x0000000116488860 + 0,00% 0x0000000116487d00: af09 40b9 | ff01 0b6b | e153 0054 | af15 40b9 | eff1 7dd3 + 0x0000000116487d14: ; implicit exception: dispatches to 0x00000001164887e8 + ;*synchronization entry + ; - java.util.stream.ReduceOps$8ReducingSink::get@-1 (line 480) + ; - java.util.stream.ReduceOps$8ReducingSink::get@1 (line 464) + ; - java.util.stream.ReduceOps$ReduceOp::evaluateSequential@12 (line 921) + ; - java.util.stream.AbstractPipeline::evaluate@88 (line 234) + 0x0000000116487d14: f00d 40b9 + 0x0000000116487d18: ;*invokeinterface get {reexecute=0 rethrow=0 return_oop=0} + ; - java.util.stream.ReduceOps$3ReducingSink::begin@5 (line 164) +.................................................................................................... + 99,51% + +....[Hottest Regions]............................................................................... + 99,51% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,04% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,04% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,04% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,03% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,02% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,02% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,02% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,02% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,02% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,01% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,14% <...other 57 warm regions...> +.................................................................................................... + 100,00% + +....[Hottest Methods (after inlining)].............................................................. + 99,66% c2, level 4 java.util.stream.AbstractPipeline::evaluate, version 4, compile id 682 + 0,23% c2, level 4 com.github.shautvast.benchmarks.loops.jmh_generated.LoopBenchmark_stream_jmhTest::stream_avgt_jmhStub, version 5, compile id 685 + 0,01% libsystem_kernel.dylib thread_self_trap + 0,00% libjvm.dylib fileStream::write(char const*, unsigned long) + 0,00% libsystem_kernel.dylib _kernelrpc_mach_port_deallocate_trap + 0,00% dyld dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 0,00% libsystem_kernel.dylib mach_absolute_time + 0,00% libsystem_kernel.dylib write + 0,00% libsystem_platform.dylib _platform_memmove + 0,00% libjvm.dylib CardTableBarrierSet::on_slowpath_allocation_exit(JavaThread*, oopDesc*) + 0,00% libsystem_platform.dylib __bzero + 0,00% libjvm.dylib JfrObjectAllocationSample::send_event(Klass const*, unsigned long, bool, Thread*) + 0,00% interpreter fstore 56 fstore + 0,00% libjvm.dylib LIR_Assembler::process_debug_info(LIR_Op*) + 0,00% libjvm.dylib MultiNode::hash() const + 0,00% libjvm.dylib CodeCache::free(CodeBlob*) + 0,00% libjvm.dylib MutatorAllocRegion::retire(bool) + 0,00% libjvm.dylib ObjAllocator::initialize(HeapWordImpl**) const + 0,00% libjvm.dylib MemNode::can_see_stored_value(Node*, PhaseTransform*) const + 0,00% libjvm.dylib OptoRuntime::new_instance_C(Klass*, JavaThread*) + 0,06% <...other 29 warm methods...> +.................................................................................................... + 100,00% + +....[Distribution by Source]........................................................................ + 99,89% c2, level 4 + 0,06% libjvm.dylib + 0,02% libsystem_kernel.dylib + 0,01% libsystem_platform.dylib + 0,01% interpreter + 0,01% libsystem_c.dylib + 0,00% libsystem_pthread.dylib + 0,00% dyld + 0,00% c1, level 3 + 0,00% libzip.dylib +.................................................................................................... + 100,00% -# Run complete. Total time: 00:06:40 + +# Run complete. Total time: 00:06:48 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 @@ -169,11 +1210,16 @@ works, and factor in a small probability of new VM bugs. Additionally, while com 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 -LoopBenchmark.cStyle avgt 5 1877,429 ± 18,547 ns/op -LoopBenchmark.enhancedForLoop avgt 5 14343,686 ± 11238,581 ns/op -LoopBenchmark.iterator avgt 5 14420,779 ± 10985,942 ns/op -LoopBenchmark.stream avgt 5 9542,921 ± 7523,289 ns/op +Benchmark Mode Cnt Score Error Units +LoopBenchmark.cStyle avgt 5 1888,196 ± 10,184 ns/op +LoopBenchmark.cStyle:·asm avgt NaN --- +LoopBenchmark.enhancedForLoop avgt 5 14380,484 ± 11060,940 ns/op +LoopBenchmark.enhancedForLoop:·asm avgt NaN --- +LoopBenchmark.iterator avgt 5 14399,423 ± 11115,231 ns/op +LoopBenchmark.iterator:·asm avgt NaN --- +LoopBenchmark.stream avgt 5 9680,119 ± 6838,907 ns/op +LoopBenchmark.stream:·asm avgt NaN --- + +MultiDim on  main [!] via ☕ v20.0.1 took 6m48s +➜ -MultiDim on  main [⇡] via ☕ v20.0.1 took 6m40s -➜ \ No newline at end of file diff --git a/src/main/java/com/github/shautvast/benchmarks/loops/LoopBenchmark.java b/src/main/java/com/github/shautvast/benchmarks/loops/LoopBenchmark.java index e6b2b27..014c03e 100644 --- a/src/main/java/com/github/shautvast/benchmarks/loops/LoopBenchmark.java +++ b/src/main/java/com/github/shautvast/benchmarks/loops/LoopBenchmark.java @@ -1,10 +1,7 @@ package com.github.shautvast.benchmarks.loops; import org.openjdk.jmh.annotations.*; -import org.openjdk.jmh.profile.AsyncProfiler; -import org.openjdk.jmh.profile.LinuxPerfAsmProfiler; -import org.openjdk.jmh.profile.Profiler; -import org.openjdk.jmh.profile.ProfilerException; +import org.openjdk.jmh.profile.*; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; @@ -69,7 +66,7 @@ public class LoopBenchmark { .forks(1) .mode(Mode.AverageTime) .timeUnit(TimeUnit.NANOSECONDS) - .addProfiler(LinuxPerfAsmProfiler.class) + .addProfiler(DTraceAsmProfiler.class) .build(); new Runner(opt).run();