[Feature] Request to revisit VirtualThreadPool optimization: Potential benchmark methodology issue
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
### Pre-check
- [x] I am sure that all the content I provide is in English.
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar feature requirement.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Descriptions
**Summary**
While reviewing the VirtualThreadPool refactoring (#16042, merged via #16055), I noticed a potential issue in the benchmark methodology that may have affected the performance conclusions. I'd like to bring this to the attention of the original authors and reviewers for re-evaluation.
**Observation**
In the benchmark code referenced in the discussion, there is a comment indicating a correction:
countDownLatch2.await(); // Fixed: should await countDownLatch2 (not the first one)
I ran some tests and found that:
When correctly awaiting countDownLatch2, the non-pooled approach (Executors.newThreadPerTaskExecutor) appears to show better performance
The pooled approach only appeared faster when the benchmark was using the incorrect latch (countDownLatch1)
This suggests the performance comparison may have been affected by synchronization timing issues rather than actual execution efficiency.
**Questions**
@funky-eyes @heliang666s @RainYuY @zrlw — Could you help verify:
Was the benchmark data in #16042 collected before or after the latch fix?
Would it be possible to re-run the benchmark with the corrected synchronization to confirm the results?
**Suggestion**
Given that the pooled implementation adds configuration complexity (THREADS_VIRTUAL_CORE), it would be valuable to ensure the performance benefits are validated with the correct measurement approach. I'm happy to assist with re-testing if needed.
Thank you for your time and for the work on this feature. Looking forward to your thoughts.
### Related issues
_No response_
### Are you willing to submit a pull request to fix on your own?
- [ ] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
Research direction
Start with the VirtualThreadPool benchmark discussed in #16042 and the refactoring merged in #16055, focusing on the countDownLatch2 await point mentioned here. Re-run the comparison between Executors.newThreadPerTaskExecutor and the pooled approach with the corrected synchronization. Done means the benchmark results and whether the optimization remains beneficial are clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100