Skip to content

Commit

Permalink
Switch to Reactor Californium SNAPSHOTs
Browse files Browse the repository at this point in the history
  • Loading branch information
bclozel committed Sep 18, 2018
1 parent 0f88ea6 commit 1b7325d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spring-boot-project/spring-boot-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<quartz.version>2.3.0</quartz.version>
<querydsl.version>4.2.1</querydsl.version>
<rabbit-amqp-client.version>5.4.1</rabbit-amqp-client.version>
<reactor-bom.version>Californium-RC1</reactor-bom.version>
<reactor-bom.version>Californium-BUILD-SNAPSHOT</reactor-bom.version>
<rest-assured.version>3.1.1</rest-assured.version>
<reactive-streams.version>1.0.2</reactive-streams.version>
<rxjava.version>1.3.8</rxjava.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private HttpServer createHttpServer() {
server = compressionCustomizer.apply(server);
}
server = server.protocol(listProtocols());
server = (this.useForwardHeaders ? server.forwarded() : server.noForwarded());
server = server.forwarded(this.useForwardHeaders);
return applyCustomizers(server);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ protected WebClient prepareCompressionTest(Compression compression) {
.getWebServer(new CharsHandler(3000, MediaType.TEXT_PLAIN));
this.webServer.start();

HttpClient client = HttpClient.create().wiretap().compress().tcpConfiguration(
HttpClient client = HttpClient.create().wiretap().compress(true).tcpConfiguration(
(tcpClient) -> tcpClient.doOnConnected((connection) -> connection
.channel().pipeline().addBefore(NettyPipeline.HttpDecompressor,
"CompressionTest", new CompressionDetectionHandler())));
Expand Down

3 comments on commit 1b7325d

@davidkiss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bclozel this is a bit offtopic, but there's a [performance test] for web frameworks(https://github.com/TechEmpower/FrameworkBenchmarks) where Vert.x application can handle 3-4x more throughput than a Webflux application with similar logic to access a PostgreSQL db using reactive-pg-client.

You can access the latest code for the Webflux app and some local test results in this PR.

Since the DAO layer is very similar in both applications, I was wondering if the delta might come from the way the two frameworks integrate with Netty? Or if webflux could be tuned with any missed configurations that I'm not aware of?

Actually, when I did a quick profiling on both applications, I found that there was a difference on how webflux integrates with Netty compared to Vert.x's solution. For some reason, the vertx solution seemed to use a bit less cpu time, too.

Since I'm not familiar with the internals of Webflux and netty, I'm wondering if there's any way to tune webflux further for better performance?

See latest test results for webflux here, though it's not including the latest improvements from the PR mentioned above.

Currently Vert.x ranks in the top 3 on the tests and I'd love to see Webflux to come closer to that, too.

@wilkinsona
Copy link
Member

@wilkinsona wilkinsona commented on 1b7325d Oct 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really the right place to have this discussion, but if you're interested purely in performance, then WebFlux.Fn should be used rather than the annotation-based programming model.

This is a major problem, IMO, with benchmarks like this as they prioritise performance over everything else. Developer productivity, the complexity of the code you have to write and the likelihood of it containing bugs, etc, are all at least as important as raw throughput.

@davidkiss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, Spring delivers well on those things you mentioned. It also does a great job on abstracting away the complexity of integrating with tools like Netty.

If there was a way to also deliver on good performance while not sacrificing any of these other aspects, it would be really awesome.

Thanks for your tip on Webflux.Fn!

Please sign in to comment.