question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to tune request parsing any further?

See original GitHub issue

I 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.

obraz

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:closed
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
adamsitnikcommented, Apr 6, 2020

I am adding some details about where the time is spent exactly:

obraz

1reaction
benaadamscommented, Apr 22, 2020

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse and Execute: SQL Tuning - Ask TOM
Here you are spending *more time parsing sql* than you do *running sql*... As Homer Simpson would say "DOH!" the good news is,...
Read more >
soft parse - Ask TOM - Oracle
soft parse TomHow is it possible that we avoid a softparse? ... I thought the application programs can also do some tuning.
Read more >
Tuning Advisor will not parse input
Tuning Advisor will not parse input Forum – Learn more on ... there are some changes in profiler for R2 which require the...
Read more >
Parsing and message flow performance
Use parser optimization techniques, such as parsing avoidance, partial parsing (parsing on demand), and opaque parsing: If possible, avoid the use of parsing...
Read more >
Improving the performance of an ANTLR parser - Strumenta
ANTLR4 based parsers enter a new stack frame for each evaluation of a rule. If you have a large set of expression rules,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found