apache/dubbo

[Feature] Request to revisit VirtualThreadPool optimization: Potential benchmark methodology issue

开放

#16,174 创建于 2026年3月26日

 (0 条评论) (0 个反应) (0 位负责人)Java (26,453 个派生)batch import
help wanted

仓库指标

星标
 (41,524 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues 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

贡献者指南