Skip to content

Conversation

MrSmoke
Copy link
Member

@MrSmoke MrSmoke commented Sep 23, 2025

Use ValueTask where possible in the response handling to reduce a few memory allocations

Old

| Method       | Mean     | Error     | StdDev    | Gen0     | Gen1    | Gen2    | Allocated |
|------------- |---------:|----------:|----------:|---------:|--------:|--------:|----------:|
| ExecuteAsync | 1.338 ms | 0.0364 ms | 0.1063 ms | 109.3750 | 35.1563 | 35.1563 | 781.78 KB |

New:

| Method       | Mean     | Error     | StdDev    | Gen0     | Gen1    | Gen2    | Allocated |
|------------- |---------:|----------:|----------:|---------:|--------:|--------:|----------:|
| ExecuteAsync | 1.438 ms | 0.0286 ms | 0.0267 ms | 109.3750 | 35.1563 | 35.1563 | 781.64 KB |

@MrSmoke MrSmoke force-pushed the httpclient/valuetask branch 2 times, most recently from a70317f to fb76e38 Compare October 20, 2025 05:35
@MrSmoke MrSmoke changed the title WIP: Httpclient/valuetask HttpClient: ValueTasks Oct 20, 2025
@MrSmoke MrSmoke requested a review from kevinwell October 20, 2025 06:51
@MrSmoke MrSmoke force-pushed the httpclient/valuetask branch from fb76e38 to 8252cc2 Compare October 22, 2025 05:41
@kevinwell kevinwell merged commit 57ef982 into master Oct 22, 2025
5 checks passed
@kevinwell kevinwell deleted the httpclient/valuetask branch October 22, 2025 05:51
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.

2 participants