You have switched threads to virtual, but you haven't added any number of threads to the pool. Each request would still take ~2 seconds and the number of threads working in parallel is the same. Why the speed difference?
@elmarbrauch9 ай бұрын
The number of kernel threads is still the same. But by using virtual threads you can create an "infinite" number of virtual threads, which are carried by the kernel threads. So the difference is, that I could start all virtual threads very early, because there is no limitation.