Files
Claude 4511cc6e6b parallel-streams: JMH benchmarks and demos for when parallel streams are slower
N x Q model, source splittability, boxing, ordered operations, common-pool
starvation, and parallel-stream correctness bugs. Captured output in output/.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6hCTuFrQT8xKmmMrF
2026-11-17 23:23:21 +05:30

400 lines
24 KiB
Plaintext

# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.parallel
# Parameters: (n = 100, q = 1)
# Run progress: 0.00% complete, ETA 00:01:36
# Fork: 1 of 1
# Warmup Iteration 1: 2.554 us/op
# Warmup Iteration 2: 2.826 us/op
# Warmup Iteration 3: 3.246 us/op
Iteration 1: 3.302 us/op
Iteration 2: 3.168 us/op
Iteration 3: 3.191 us/op
Iteration 4: 3.197 us/op
Iteration 5: 3.276 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.parallel":
3.227 ±(99.9%) 0.227 us/op [Average]
(min, avg, max) = (3.168, 3.227, 3.302), stdev = 0.059
CI (99.9%): [3.000, 3.453] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.parallel
# Parameters: (n = 100, q = 100)
# Run progress: 8.33% complete, ETA 00:01:30
# Fork: 1 of 1
# Warmup Iteration 1: 17.115 us/op
# Warmup Iteration 2: 19.112 us/op
# Warmup Iteration 3: 17.243 us/op
Iteration 1: 17.042 us/op
Iteration 2: 18.133 us/op
Iteration 3: 18.558 us/op
Iteration 4: 16.680 us/op
Iteration 5: 14.709 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.parallel":
17.024 ±(99.9%) 5.796 us/op [Average]
(min, avg, max) = (14.709, 17.024, 18.558), stdev = 1.505
CI (99.9%): [11.228, 22.821] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.parallel
# Parameters: (n = 10000, q = 1)
# Run progress: 16.67% complete, ETA 00:01:22
# Fork: 1 of 1
# Warmup Iteration 1: 41.559 us/op
# Warmup Iteration 2: 41.886 us/op
# Warmup Iteration 3: 40.756 us/op
Iteration 1: 45.860 us/op
Iteration 2: 45.214 us/op
Iteration 3: 45.519 us/op
Iteration 4: 45.168 us/op
Iteration 5: 44.723 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.parallel":
45.297 ±(99.9%) 1.633 us/op [Average]
(min, avg, max) = (44.723, 45.297, 45.860), stdev = 0.424
CI (99.9%): [43.664, 46.929] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.parallel
# Parameters: (n = 10000, q = 100)
# Run progress: 25.00% complete, ETA 00:01:14
# Fork: 1 of 1
# Warmup Iteration 1: 818.776 us/op
# Warmup Iteration 2: 723.115 us/op
# Warmup Iteration 3: 683.672 us/op
Iteration 1: 695.548 us/op
Iteration 2: 677.217 us/op
Iteration 3: 702.129 us/op
Iteration 4: 691.356 us/op
Iteration 5: 678.731 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.parallel":
688.996 ±(99.9%) 41.521 us/op [Average]
(min, avg, max) = (677.217, 688.996, 702.129), stdev = 10.783
CI (99.9%): [647.475, 730.518] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.parallel
# Parameters: (n = 1000000, q = 1)
# Run progress: 33.33% complete, ETA 00:01:06
# Fork: 1 of 1
# Warmup Iteration 1: 2051.571 us/op
# Warmup Iteration 2: 1906.834 us/op
# Warmup Iteration 3: 2024.894 us/op
Iteration 1: 1801.248 us/op
Iteration 2: 1801.422 us/op
Iteration 3: 1950.267 us/op
Iteration 4: 2295.446 us/op
Iteration 5: 1913.766 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.parallel":
1952.430 ±(99.9%) 781.640 us/op [Average]
(min, avg, max) = (1801.248, 1952.430, 2295.446), stdev = 202.989
CI (99.9%): [1170.790, 2734.070] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.parallel
# Parameters: (n = 1000000, q = 100)
# Run progress: 41.67% complete, ETA 00:00:57
# Fork: 1 of 1
# Warmup Iteration 1: 67554.950 us/op
# Warmup Iteration 2: 63880.972 us/op
# Warmup Iteration 3: 67555.514 us/op
Iteration 1: 66500.964 us/op
Iteration 2: 66413.244 us/op
Iteration 3: 65635.051 us/op
Iteration 4: 68084.734 us/op
Iteration 5: 64267.643 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.parallel":
66180.327 ±(99.9%) 5356.241 us/op [Average]
(min, avg, max) = (64267.643, 66180.327, 68084.734), stdev = 1390.999
CI (99.9%): [60824.086, 71536.569] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.sequential
# Parameters: (n = 100, q = 1)
# Run progress: 50.00% complete, ETA 00:00:49
# Fork: 1 of 1
# Warmup Iteration 1: 0.385 us/op
# Warmup Iteration 2: 0.359 us/op
# Warmup Iteration 3: 0.337 us/op
Iteration 1: 0.338 us/op
Iteration 2: 0.343 us/op
Iteration 3: 0.352 us/op
Iteration 4: 0.346 us/op
Iteration 5: 0.344 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.sequential":
0.345 ±(99.9%) 0.020 us/op [Average]
(min, avg, max) = (0.338, 0.345, 0.352), stdev = 0.005
CI (99.9%): [0.324, 0.365] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.sequential
# Parameters: (n = 100, q = 100)
# Run progress: 58.33% complete, ETA 00:00:41
# Fork: 1 of 1
# Warmup Iteration 1: 13.752 us/op
# Warmup Iteration 2: 13.339 us/op
# Warmup Iteration 3: 13.433 us/op
Iteration 1: 13.190 us/op
Iteration 2: 12.791 us/op
Iteration 3: 12.906 us/op
Iteration 4: 12.862 us/op
Iteration 5: 13.182 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.sequential":
12.986 ±(99.9%) 0.719 us/op [Average]
(min, avg, max) = (12.791, 12.986, 13.190), stdev = 0.187
CI (99.9%): [12.267, 13.705] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.sequential
# Parameters: (n = 10000, q = 1)
# Run progress: 66.67% complete, ETA 00:00:33
# Fork: 1 of 1
# Warmup Iteration 1: 33.847 us/op
# Warmup Iteration 2: 34.601 us/op
# Warmup Iteration 3: 32.702 us/op
Iteration 1: 31.444 us/op
Iteration 2: 31.912 us/op
Iteration 3: 31.441 us/op
Iteration 4: 36.858 us/op
Iteration 5: 33.124 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.sequential":
32.956 ±(99.9%) 8.808 us/op [Average]
(min, avg, max) = (31.441, 32.956, 36.858), stdev = 2.287
CI (99.9%): [24.147, 41.764] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.sequential
# Parameters: (n = 10000, q = 100)
# Run progress: 75.00% complete, ETA 00:00:24
# Fork: 1 of 1
# Warmup Iteration 1: 1323.332 us/op
# Warmup Iteration 2: 1291.482 us/op
# Warmup Iteration 3: 1267.897 us/op
Iteration 1: 1298.120 us/op
Iteration 2: 1318.923 us/op
Iteration 3: 1306.951 us/op
Iteration 4: 1287.234 us/op
Iteration 5: 1314.010 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.sequential":
1305.048 ±(99.9%) 48.775 us/op [Average]
(min, avg, max) = (1287.234, 1305.048, 1318.923), stdev = 12.667
CI (99.9%): [1256.273, 1353.823] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.sequential
# Parameters: (n = 1000000, q = 1)
# Run progress: 83.33% complete, ETA 00:00:16
# Fork: 1 of 1
# Warmup Iteration 1: 3185.234 us/op
# Warmup Iteration 2: 3270.377 us/op
# Warmup Iteration 3: 3403.997 us/op
Iteration 1: 3126.314 us/op
Iteration 2: 3046.140 us/op
Iteration 3: 3579.626 us/op
Iteration 4: 3076.687 us/op
Iteration 5: 3034.810 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.sequential":
3172.715 ±(99.9%) 886.464 us/op [Average]
(min, avg, max) = (3034.810, 3172.715, 3579.626), stdev = 230.212
CI (99.9%): [2286.252, 4059.179] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 25.0.5, OpenJDK 64-Bit Server VM, 25.0.5+8-LTS
# VM invoker: /tmp/tools/jdk-25.0.5+8/bin/java
# VM options: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=JKS -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=42575 -Dhttp.nonProxyHosts=localhost|127.0.0.1|::1|127.*|0.*|::|169.254.*|api.anthropic.com|api-staging.anthropic.com|api-pr-preview.anthropic.com|mcp-proxy.anthropic.com|mcp-proxy-staging.anthropic.com|registry.npmjs.org|jsr.io|npm.jsr.io|pypi.org|files.pythonhosted.org|index.crates.io|proxy.golang.org|host.docker.internal|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|192.168.*|100.64.0.0/10|*.svc.cluster.local|*.svc.cluster.local -Djdk.http.auth.tunneling.disabledSchemes= -Djdk.http.auth.proxying.disabledSchemes=
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: com.ankurm.parallelstreams.NqBenchmark.sequential
# Parameters: (n = 1000000, q = 100)
# Run progress: 91.67% complete, ETA 00:00:08
# Fork: 1 of 1
# Warmup Iteration 1: 125134.566 us/op
# Warmup Iteration 2: 121151.145 us/op
# Warmup Iteration 3: 126327.662 us/op
Iteration 1: 127210.986 us/op
Iteration 2: 127633.563 us/op
Iteration 3: 126364.109 us/op
Iteration 4: 131880.637 us/op
Iteration 5: 124313.179 us/op
Result "com.ankurm.parallelstreams.NqBenchmark.sequential":
127480.495 ±(99.9%) 10673.912 us/op [Average]
(min, avg, max) = (124313.179, 127480.495, 131880.637), stdev = 2771.981
CI (99.9%): [116806.582, 138154.407] (assumes normal distribution)
# Run complete. Total time: 00:01:39
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 (n) (q) Mode Cnt Score Error Units
NqBenchmark.parallel 100 1 avgt 5 3.227 ± 0.227 us/op
NqBenchmark.parallel 100 100 avgt 5 17.024 ± 5.796 us/op
NqBenchmark.parallel 10000 1 avgt 5 45.297 ± 1.633 us/op
NqBenchmark.parallel 10000 100 avgt 5 688.996 ± 41.521 us/op
NqBenchmark.parallel 1000000 1 avgt 5 1952.430 ± 781.640 us/op
NqBenchmark.parallel 1000000 100 avgt 5 66180.327 ± 5356.241 us/op
NqBenchmark.sequential 100 1 avgt 5 0.345 ± 0.020 us/op
NqBenchmark.sequential 100 100 avgt 5 12.986 ± 0.719 us/op
NqBenchmark.sequential 10000 1 avgt 5 32.956 ± 8.808 us/op
NqBenchmark.sequential 10000 100 avgt 5 1305.048 ± 48.775 us/op
NqBenchmark.sequential 1000000 1 avgt 5 3172.715 ± 886.464 us/op
NqBenchmark.sequential 1000000 100 avgt 5 127480.495 ± 10673.912 us/op