Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProcessRequest is not async method #1464

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

adamsitnik
Copy link
Contributor

while working on dotnet/runtime#33669 I've realized that ProcessRequestAsync is not really an async method, so we can remove this one extra await

It gives an extra +20-40k for Plaintext RPS

@sebastienros PTAL

@sebastienros sebastienros merged commit 8265443 into aspnet:master Mar 19, 2020
@sebastienros
Copy link
Member

We'll let it run and then submit the change to TE.

@benaadams
Copy link
Contributor

We'll let it run and then submit the change to TE.

Trickier because TE does have async methods e.g DB stuff (benchmarks isn't in line with TE code) https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.cs#L106-L140

@sebastienros
Copy link
Member

Should we refactor TE's code for this non-async path?
And probably sync the two apps so we are testing what's on TE.

@benaadams
Copy link
Contributor

Should we refactor TE's code for this non-async path?

It returns a Task.Completed so could be changed to

  if (_state == State.Body)
  {
-     await ProcessRequestAsync();
+     var reqTask = ProcessRequestAsync();
+     if (!reqTask.IsCompletedSuccessfully)
+     {
+         await reqTask;
+     }

      _state = State.StartLine;

Or split the app into two with #defines?

And probably sync the two apps so we are testing what's on TE.

Probably :)

@sebastienros
Copy link
Member

I can try this change here, while syncing the app. thanks.

@benaadams
Copy link
Contributor

Added sync TechEmpower/FrameworkBenchmarks#5579

and sync here to include the db async stuff #1472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants