Return to search

Comparing Virtual Threads and Reactive Webflux in Spring : A Comparative Performance Analysis of Concurrency Solutions in Spring / Jämförelse av virtuella trådar och Reactive WebFlux i Spring : En jämförande analys av lösningar för samtidighet i Spring

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. / För att utveckla högpresterande webbtjänster i Java har Reactive WebFlux varit det främsta alternativet. Med introduktionen av virtuella trådar i Java 19 har spekulerats kunna ersätta reaktiva webbtjänster. Detta arbete presenterar prestandaskillnaden mellan Spring-applikationer som drivs av normala trådar, virtuella trådar och dess reaktiva motsvarighet Reactive WebFlux. Testerna utfördes genom att skapa tre pro- totyper, som användes för att anropa en slutpunkt med en satt fördröjningstid och öka antalet förfrågningar per sekund fram till systemfel. Resultaten visade att proto- typen med virtuella trådar presterade något bättre än den reaktiva prototypen. Där- emot är det ännu oklart om Reactive WebFlux-applikationen med en optimal webb- server skulle producera ett annat resultat. Dessutom skulle det vara intressant för framtida forskning om hur virtuella trådar fungerar med databasanvändning.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:kth-328247
Date January 2023
CreatorsHaneklint, Carl, Joo, Yo Han
PublisherKTH, Hälsoinformatik och logistik
Source SetsDiVA Archive at Upsalla University
LanguageEnglish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess
RelationTRITA-CBH-GRU ; 2023:086

Page generated in 0.0027 seconds