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

feat: change IPerformanceService to return HttpResponseMessage #1893

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

TimothyMakkison
Copy link
Contributor

@TimothyMakkison TimothyMakkison commented Oct 24, 2024

Change return types from Task<string> to Task<HttpResponseMessage. This makes the benchmarks more accurate as they are intended to measure the cost of configuring and sending a HttpRequestMessage and not the time taken to convert the response into a string.

On a related note why isn't refit using ReadAsStringAsync?

New Benchmark

Method Mean Error StdDev Gen0 Allocated
ConstantRouteAsync 2.072 us 0.0110 us 0.0097 us 0.2937 2.71 KB
DynamicRouteAsync 2.783 us 0.0259 us 0.0202 us 0.3319 3.07 KB
ComplexDynamicRouteAsync 4.060 us 0.0226 us 0.0200 us 0.4044 3.78 KB
ObjectRequestAsync 4.954 us 0.0295 us 0.0262 us 0.4807 4.48 KB
ComplexRequestAsync 14.455 us 0.0686 us 0.0642 us 1.1597 10.67 KB

Old

Method Mean Error StdDev Gen0 Gen1 Allocated
ConstantRouteAsync 2.045 us 0.0395 us 0.0638 us 0.6828 0.0114 6.28 KB
DynamicRouteAsync 2.601 us 0.0518 us 0.0532 us 0.7172 0.0038 6.6 KB
ComplexDynamicRouteAsync 3.799 us 0.0651 us 0.0891 us 0.7858 - 7.24 KB
ObjectRequestAsync 4.560 us 0.0886 us 0.1021 us 0.8698 - 8.05 KB
ComplexRequestAsync 12.951 us 0.2575 us 0.4643 us 1.5259 - 14.19 KB

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.28%. Comparing base (6ebeda5) to head (8eda6ae).
Report is 144 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1893      +/-   ##
==========================================
- Coverage   87.73%   84.28%   -3.45%     
==========================================
  Files          33       36       +3     
  Lines        2348     2476     +128     
  Branches      294      347      +53     
==========================================
+ Hits         2060     2087      +27     
- Misses        208      310     +102     
+ Partials       80       79       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisPulman ChrisPulman merged commit 6de1dbb into reactiveui:main Oct 26, 2024
2 of 3 checks passed
@ChrisPulman
Copy link
Member

If ReadAsStringAsync provides the same output long term than existing methods then I see no reason not to use it.

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants