hantsy / spring-reactive-sample

Spring 5/6 Reactive playground
https://hantsy.github.io/spring-reactive-sample/
GNU General Public License v3.0
1.33k stars 463 forks source link

More analysis on performance gain. #12

Closed tvdinh closed 5 years ago

tvdinh commented 5 years ago

Hi @hantsy : Thanks a lot for putting our this useful sample code/tutorial. A great show case of spring reactive.

It would be great if you can also put together a performance gain benefit comparison between using spring reactive/ and typical spring mvc, focusing Reactive key features like backpressure or async, non-blocking I/O. For example, let's say we flush the Mongo DB with hundreds of thousands of write "Post", can we show somewhere in the logs that the server is telling the client to slowdown etc.

Regards, Tuan

hantsy commented 5 years ago

@tvdinh This repository hosts samples of reactive stack brought by Spring 5.x. If you want to compare the performance, try this repo: https://github.com/dsyer/spring-boot-startup-bench, I think it is helpful to setup a benchmark for different stacks.

tvdinh commented 5 years ago

@hantsy That repo is the bench for springboot start-up. I am more interested in Spring webflux (reactive support) vs Spring MVC (non-reactive). Basically to answer the question why should someone use Spring Webflux ?

E.g: Given a use case, if we use normal Spring MVC or any non-reactive approach, the Round-Trip-Time is xxx, and with Spring WebFlux (supports non-blocking, backpressure) the Round-Trip-Time is now yyy. And yyy is better than xxx, hence WebFlux benefits....

Any idea if someone has done it before ?... Anyway, thanks for the reply.

tvdinh commented 5 years ago

@hantsy: found one https://medium.com/@the.raj.saxena/springboot-2-performance-servlet-stack-vs-webflux-reactive-stack-528ad5e9dadc in case you are also interested. Repo: https://github.com/raj-saxena/spring-boot-1-vs-2-performance