Comparing Virtual Threads and Reactive Webflux in Spring : A Comparative Performance Analysis of Concurrency Solutions in Spring

University essay from KTH/Hälsoinformatik och logistik

Abstract: To develop a high performant web service in Java, Reactive WebFlux has previously been utilized as the only alternative. With the introduction of virtual threads in Java 19, it has been considered that it would be an alternative to the current provided option. This paper presents the performance difference between Spring applications powered by normal threads, virtual threads, and its reactive counterpart Reactive WebFlux. The tests were done by creating three prototypes, which were used to call an endpoint with a set delay time and increasing the number of requests per second until system failure. The results show that the virtual threaded prototypes performed slightly better than the reactive prototype. The question remains whether the Reac- tive WebFlux application using the most optimal web server produces a different re- sult, as well as future research on how virtual threads perform with database usage.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)