Repository navigation
Improve the performance of connection filters - #1021
Conversation
Not a super drastic improvement. It looks like wrapping |
| { | ||
| public static class SocketInputExtensions | ||
| { | ||
| public static void IncomingData(this SocketInput input, byte[] buffer, int offset, int count) |
|
|
|
@halter73: Please wait until I've added this scenario to Benchmarks (aspnet/Benchmarks#109) so we can see the perf improvement in our automated results. PR is ready, just needs a |
|
It's hard to tell since the results have a lot of variance, but I'm not seeing a clear improvement from this change: |
|
Does it fix the ssl async-over-sync on full framework as suggested? If so I'd take it regardless... as it ties capacity to min threadpool threads |
|
@benaadams: How would one test the "ssl async-over-sync"? Just benchmark plaintext over HTTPS using full framework rather than core? |
|
@mikeharder try plaintext over HTTPS on full framework, but switch the
|
| /// </summary> | ||
| public void Start() | ||
| { | ||
| Reset(); |
There was a problem hiding this comment.
Why did you move this here? It was bad in the ctor so I like that you moved it here, but just wondering if there were other reasons.
There was a problem hiding this comment.
Mostly so we don't have to call it in Connection.ApplyConnectionFilter().
|
lgtm 🚢 (but wait for @mikeharder 😄 ) |
|
Regardless of the performance improvement, the code is better and fixes some problems (async await FTW) |
|
I'm not opposed to the change, just wanted to make it clear I don't see a perf benefit in Plaintext. I'll test JSON as well. |
|
Not seeing any difference with https on full framework with the above middleware (pre and post)? |
|
@benaadams Haven't tested full framework yet, will try today. |
|
The benchmarks show that SSL on full framework is much better (read less broken) after this change. The BenchmarksDriver doesn't support full framework atm, so I ran some tests on my dev machine. This was enough to show a big difference. Basically after the change, Kestrel doesn't fall over with a bunch of HTTPS connections on full framework: halter73/better-filters below |
- Add Begin/End Write methods to FrameResponseStream - Fix state check of Begin/End Read methods in FrameRequestStream
- Buffer connection filter input less by using ProducingStart/Complete - Simplify FilteredStreamAdapter
c7a2eda to
9727a4d
Compare
|
I thought it might make a difference in a big way. Current, full framework workaround is to set the environment variable
Though that isn't a very good solution; have removed the example code. 🚀 |
Fixes #768