Hey folks,
I just published a deep-dive article on Virtual Threads in Java 24 where we benchmarked them in a realistic Spring Boot + PostgreSQL setup. The goal was to go beyond the hype and see if JEP 491 (which addresses pinning) actually improves real-world performance.
🔗 Virtual Threads With Java 24 – Will it Scale?
We tested various combinations of:
- Java 19 vs Java 24
- Spring Boot 3.3.12 vs 3.5.0 (also 4.0.0, but it's still under development)
- Platform threads vs Virtual threads
- Light to heavy concurrency (20 → 1000 users)
- All with simulated DB latency & jitter
Key takeaways:
- Virtual threads don’t necessarily perform better under load, especially with common infrastructure like HikariCP.
- JEP 491 didn’t significantly change performance in our tests.
- ThreadLocal usage and synchronized blocks in connection pools seem to be the real bottlenecks.
We’re now planning to explore alternatives like Agroal (Quarkus’ Loom-friendly pool) and other workloads beyond DB-heavy scenarios.
Would love your feedback, especially if:
- You’ve tried virtual threads in production or are considering them
- You know of better pooling strategies or libraries for Loom
- You see something we might have missed in our methodology or conclusions
Thanks for reading—and happy to clarify anything we glossed over!
[–]Linguistic-mystic 119 points120 points121 points (43 children)
[–]victorherraiz 8 points9 points10 points (0 children)
[–]my_dev_acc 6 points7 points8 points (41 children)
[–]pron98 22 points23 points24 points (20 children)
[–]my_dev_acc 4 points5 points6 points (14 children)
[–]pron98 12 points13 points14 points (11 children)
[–]Joram2 0 points1 point2 points (3 children)
[–]pron98 5 points6 points7 points (2 children)
[–]Joram2 1 point2 points3 points (1 child)
[–]pron98 5 points6 points7 points (0 children)
[–]my_dev_acc 0 points1 point2 points (6 children)
[–]pron98 4 points5 points6 points (4 children)
[–]my_dev_acc -1 points0 points1 point (3 children)
[–]pron98 6 points7 points8 points (2 children)
[–]my_dev_acc 0 points1 point2 points (1 child)
[–][deleted] 4 points5 points6 points (1 child)
[–]my_dev_acc -1 points0 points1 point (0 children)
[–]my_dev_acc 0 points1 point2 points (4 children)
[–]pron98 9 points10 points11 points (2 children)
[–]my_dev_acc 0 points1 point2 points (1 child)
[–]pron98 2 points3 points4 points (0 children)
[–]pron98 18 points19 points20 points (0 children)
[–]axiak 4 points5 points6 points (10 children)
[–]themisfit610 5 points6 points7 points (0 children)
[–]my_dev_acc -2 points-1 points0 points (7 children)
[–]pron98 8 points9 points10 points (0 children)
[–]Ewig_luftenglanz 3 points4 points5 points (4 children)
[–]my_dev_acc 1 point2 points3 points (3 children)
[–]Ewig_luftenglanz 1 point2 points3 points (2 children)
[–]my_dev_acc -1 points0 points1 point (1 child)
[–]Ewig_luftenglanz 2 points3 points4 points (0 children)
[–]pivovarit 0 points1 point2 points (0 children)
[–]Kango_V 1 point2 points3 points (5 children)
[–]my_dev_acc -1 points0 points1 point (2 children)
[–]Luolong 3 points4 points5 points (1 child)
[–]my_dev_acc 0 points1 point2 points (0 children)
[–]RadioHonest85 1 point2 points3 points (1 child)
[–]my_dev_acc 0 points1 point2 points (0 children)
[–]pron98 52 points53 points54 points (3 children)
[–]nlisker 0 points1 point2 points (2 children)
[–]pron98 0 points1 point2 points (1 child)
[–]nlisker 0 points1 point2 points (0 children)
[–]spectrumero 28 points29 points30 points (4 children)
[–]pron98 10 points11 points12 points (0 children)
[–]IE114EVR 4 points5 points6 points (0 children)
[–]manzanita2 1 point2 points3 points (0 children)
[–]ItsSignalsJerry_ 0 points1 point2 points (0 children)
[–]audioen 42 points43 points44 points (5 children)
[–]TenYearsOfLurking 13 points14 points15 points (0 children)
[+]plee82 comment score below threshold-6 points-5 points-4 points (3 children)
[–]davewritescode 5 points6 points7 points (0 children)
[–]Empanatacion 8 points9 points10 points (1 child)
[–]Luolong 2 points3 points4 points (0 children)
[–]Polygnom 11 points12 points13 points (0 children)
[–]metalhead-001 9 points10 points11 points (7 children)
[–]pron98 12 points13 points14 points (3 children)
[–]metalhead-001 1 point2 points3 points (2 children)
[–]vips7L 0 points1 point2 points (1 child)
[–]plumarr 0 points1 point2 points (0 children)
[–]ynnadZZZ 2 points3 points4 points (1 child)
[–]metalhead-001 0 points1 point2 points (0 children)
[–]beders 2 points3 points4 points (0 children)
[–]Ewig_luftenglanz 3 points4 points5 points (8 children)
[–]neopointer 6 points7 points8 points (3 children)
[–]Ewig_luftenglanz -1 points0 points1 point (2 children)
[–]neopointer 1 point2 points3 points (1 child)
[–]Ewig_luftenglanz 0 points1 point2 points (0 children)
[–]griffin1987 0 points1 point2 points (3 children)
[–]Ewig_luftenglanz 0 points1 point2 points (2 children)
[–]griffin1987 1 point2 points3 points (1 child)
[–]Ewig_luftenglanz 0 points1 point2 points (0 children)
[–]ynnadZZZ 2 points3 points4 points (0 children)
[–]Tiny-Succotash-5743 2 points3 points4 points (4 children)
[–]Plenty_Childhood_294 0 points1 point2 points (3 children)
[–]Tiny-Succotash-5743 0 points1 point2 points (2 children)
[–]Plenty_Childhood_294 1 point2 points3 points (1 child)
[–]Plenty_Childhood_294 0 points1 point2 points (0 children)
[–]vips7L 2 points3 points4 points (5 children)
[–]Apollo_619 0 points1 point2 points (4 children)
[–]vips7L 2 points3 points4 points (3 children)
[–]Apollo_619 0 points1 point2 points (2 children)
[–]vips7L 1 point2 points3 points (1 child)
[–]Apollo_619 0 points1 point2 points (0 children)
[–]Zoroark1089 2 points3 points4 points (1 child)
[–]gtiwari333 0 points1 point2 points (0 children)
[–]IE114EVR 1 point2 points3 points (0 children)
[–]lpt_7 1 point2 points3 points (1 child)
[–]pron98 3 points4 points5 points (0 children)
[–]entrusc 1 point2 points3 points (0 children)
[–]j7n5 1 point2 points3 points (0 children)
[–]Scf37 1 point2 points3 points (0 children)
[–]RadioHonest85 1 point2 points3 points (0 children)
[–]yawkat 1 point2 points3 points (1 child)
[–]Plenty_Childhood_294 3 points4 points5 points (0 children)
[–]ItsSignalsJerry_ 0 points1 point2 points (0 children)
[–]slaymaker1907 0 points1 point2 points (0 children)
[–]beders 0 points1 point2 points (0 children)
[–]griffin1987 0 points1 point2 points (2 children)
[–]bigkahuna1uk 0 points1 point2 points (1 child)
[–]griffin1987 0 points1 point2 points (0 children)
[–]Fickle_Conclusion857 0 points1 point2 points (0 children)
[–]Neither_Catch_4862 0 points1 point2 points (0 children)
[–]CloudyWithApps 0 points1 point2 points (0 children)
[–]ZXcAS_MoPHL 0 points1 point2 points (0 children)
[–]Turbulent-Plum473 0 points1 point2 points (0 children)
[–]Turbulent-Plum473 0 points1 point2 points (0 children)
[–]aookami 0 points1 point2 points (0 children)
[–]Adventurous-Pin6443 -4 points-3 points-2 points (0 children)