I’m trying to switch from the blocking java driver to the new driver with the reactive interface, but I’m facing some serious performance bottleneck.
While migrating our application to spring reactor (using spring data mongodb), I noticed poor performances that could be more than half the existing, so I ran some tests and ended-up with the following: github/Tiller/mongo-perfs (sorry, I can only put 2 links in my post. Direct link in the table below)
Setting aside the spring-data overhead, just by focusing on the blocking driver result vs the reactive driver result, we see a ~40% decrease in performance.
|Test||Mean Time (s)||Diff Base Driver||Diff Base Reactive Driver|
|Java Driver (testRaw)||3.320||+0%|
|Java Reactive Driver (testReactiveRaw)||4.627||+39%|
I ran the same test on a different setup today, and ended-up with a similar result, ~14.5s on the blocking driver and ~20.5s on the reactive driver.
Is my testing flawed in anyway? Or does the reactive driver just come with this performance hit when doing large amount of queries?