Benchmarks icon indicating copy to clipboard operation
Benchmarks copied to clipboard

Use optimized content type for MVC actions

Open sebastienros opened this issue 7 years ago • 2 comments

TE warning in the build log

     Content encoding found in "application/json; charset=utf-8" where "application/json" is acceptable.
     Additional response bytes may negatively affect benchmark performance.
     See http://frameworkbenchmarks.readthedocs.org/en/latest/Project-Information/Framework-Tests/#specific-test-requirements

All these MVC actions use [Produces("application/json")]. Maybe we can use a better way to set the content type to improve it.

https://travis-ci.org/TechEmpower/FrameworkBenchmarks/jobs/342443158

sebastienros avatar Feb 17 '18 02:02 sebastienros

@davidfowl any idea? Otherwise I will investigate

sebastienros avatar Feb 17 '18 02:02 sebastienros

System.Net.Http.StringContent always setting charset whether you want it or not? https://github.com/dotnet/corefx/issues/25290

System/Net/Http/StringContent.cs#L26-L34

headerValue.CharSet = (encoding == null) ? HttpContent.DefaultStringEncoding.WebName : encoding.WebName;

Headers.ContentType = headerValue;

benaadams avatar Feb 17 '18 02:02 benaadams