aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Use ArgumentOutOfRangeException Throw methods in SendFileResponseExtensions..CheckRange

Open paulomorgado opened this issue 1 year ago • 6 comments

To allow inlining by the JIT.

Use ArgumentOutOfRangeException Throw methods in SendFileResponseExtensions..CheckRange to allow inlining by the JIT

  • [x] You've read the Contributor Guide and Code of Conduct.
  • [x] You've included unit or integration tests for your change, where applicable.
  • [x] You've included inline docs for your change, where applicable.
  • [x] There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)

Description

Methods that throw exceptions are not inlinable by the JIT.

This PR uses the recently introduced throw methods in the ArgumentOutOfRangeException to allow the logic to be fully inlined in non-error situations to increase performance of static file responses.

paulomorgado avatar Jun 24 '24 09:06 paulomorgado

FYI @captainsafia, I've enable auto-merge, since it seems straightforward. You have two hours to shout if you disagree. :wink:

amcasey avatar Jun 27 '24 18:06 amcasey

@captainsafia, @amcasey, looks like the build still has issues.

paulomorgado avatar Jun 28 '24 17:06 paulomorgado

/azp run

amcasey avatar Jun 28 '24 17:06 amcasey

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Jun 28 '24 17:06 azure-pipelines[bot]

@paulomorgado When that happens, you should be able to unblock yourself by closing and re-opening the PR. (We're happy to help, but you don't have to wait for us.) Obviously, we're working on making it happen less often.

amcasey avatar Jun 28 '24 17:06 amcasey

But you don't need to do it after we manually restart the tests with /azp run. 😛

amcasey avatar Jun 28 '24 17:06 amcasey

Ack, apparently close and re-open disables auto-merge. TIL. Sorry about that.

amcasey avatar Jul 15 '24 19:07 amcasey