olka opened a new pull request, #6685: URL: https://github.com/apache/jmeter/pull/6685
## Summary - **Virtual threads for sampler execution**: `ThreadGroup` now uses `Thread.ofVirtual()` for sampler threads and thread starters, reducing OS thread creation by ~3.5x (65 vs 226 thread creates for 200 concurrent users) - **`synchronized` → `ReentrantLock`** conversions in `StandardJMeterEngine`, `ThreadGroup`, `JMeterContextService`, `TestCompiler`, `AbstractThreadGroup` to avoid virtual thread carrier pinning - **Java 21 API migration**: deprecated `new URL()` → `URI.create().toURL()` in test code, `@SuppressWarnings` for production code where URI is too strict, `new Locale()` → `Locale.of()`, `Thread.getId()` → `threadId()`, removed deprecated `ThreadDeath` / `System.runFinalization()` usage - **Build target**: Java 21 ### Design decision `StandardJMeterEngine.EXECUTOR_SERVICE` uses `Thread.ofPlatform()` (not virtual) — virtual threads are daemon threads and would cause immediate JVM exit in non-GUI mode. Sampler threads remain virtual, tracked via `waitThreadsStopped()`. ## A/B Test Results (200 threads, 180s, 30ms server delay) | Metric | Virtual Threads | Platform Threads (master) | |---|---|---| | Throughput | ~2,450 req/s | ~2,390 req/s | | Avg latency | 79ms | 81ms | | Max latency | 6.5s | 7.6s | | OS thread creates (JFR) | 65 | 226 | | Thread alloc stats (JFR) | 146 | 470 | ## Test plan - [x] `./gradlew check` — all tests pass (only pre-existing `batchFTP_TESTS` external dependency failure) - [x] 180s load test with 200 threads: 440k+ requests, 0 JMeter errors - [x] JFR comparison: virtual threads vs platform threads - [ ] Distributed mode testing (engine executor + remote engines) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
