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
This commit is contained in:
Claude
2026-11-17 23:23:21 +05:30
parent f8c9e244a3
commit 4511cc6e6b
22 changed files with 1714 additions and 0 deletions
@@ -0,0 +1,15 @@
availableProcessors = 2
commonPool parallelism = 3
1. Victim alone
victim took 201 ms
2. Victim while a neighbour BLOCKS the common pool (8 tasks x 2000 ms)
victim took 803 ms
3. Same neighbour, but it runs in its OWN ForkJoinPool(3)
victim took 200 ms
4. 20 blocking tasks x 200 ms: parallel stream vs virtual threads
parallel stream : 1002 ms
virtual threads : 216 ms