http4s / http4s-servlet

http4s-servlet support
Apache License 2.0
6 stars 5 forks source link

Create a sequential dispatcher for each request and response #170

Open rossabaker opened 1 year ago

rossabaker commented 1 year ago

This tests the theory of #157 that a sequential dispatcher will help performance.

I thought request and response could share, but creating the request and response on a compute thread rather than the servlet thread results in null path infos being passed to the HTTP app in the tests. This creates the dispatcher for the bodies, where we already have effects.

rossabaker commented 1 year ago

I don't have a performance test harness for this backend. Perhaps @bastewart or @TimWSpence could give it a try?

rossabaker commented 1 year ago

It's 0.23.13-3-ad7196e-20230124T051427Z-SNAPSHOT in Maven Central snapshots.

rossabaker commented 1 year ago

Also, the diff is mostly whitespace.

TimWSpence commented 1 year ago

I don't have a performance test harness for this backend. Perhaps @bastewart or @TimWSpence could give it a try?

Thanks Ross! Just linked this to https://github.com/http4s/http4s-servlet/pull/171 which includes some initial benchmarks at least. I haven't included results from using a parallel dispatcher but can do if that's helpful. Parallel is noticeably slower (and possibly not correct unless I've missed something?)

rossabaker commented 1 year ago

Parallel is definitely incorrect. See #172.