Is it possible to tune request parsing any further?
See original GitHub issueI am currently working on improving our results in the JSON TechEmpower benchmark.
We got to the point, where everything was already tuned at least once and even 1% matters.
The majority of time is spent on necessary work like sending & receiving messages, epoll & thread pool scheduling that are hard or impossible to optimize any further.
For the JSON Platform benchmark, we spent 5% of the time on parsing headers.
If I remove it, I get something around 40-50k RPS gain.
@GrabYourPitchforks is there any chance that you could take a look at the parsing logic and see if there are any possibilities to optimize it any further? I know that you have a LOT of expertise in the low-level tuning of text operations.
I’ve prepared a copy of the TE logic and encapsulated it into a benchmark that can be run by doing the following:
git clone https://github.com/adamsitnik/aspnetcore.git parsing
cd parsing
git checkout techEmpowerParsing
./build.sh
./.dotnet/dotnet run -c Release -f netcoreapp5.0 --filter TechEmpowerHttpParserBenchmark --project ./src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj --cli ./.dotnet/dotnet
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (17 by maintainers)
Top GitHub Comments
I am adding some details about where the time is spent exactly:
Safe and fast startline parsing is ready for review https://github.com/dotnet/aspnetcore/pull/20885
Note: this will break PlatformBenchmarks due to change in api; though it should be pretty quick to fix up (have most of it in-place in another PR)