{"id":16678949,"url":"https://github.com/joncloud/net-http-perf","last_synced_at":"2026-04-21T18:32:30.424Z","repository":{"id":78825315,"uuid":"102928495","full_name":"joncloud/net-http-perf","owner":"joncloud","description":null,"archived":false,"fork":false,"pushed_at":"2020-06-13T21:28:07.000Z","size":14,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"publish","last_synced_at":"2025-03-06T04:36:31.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joncloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-09T05:05:29.000Z","updated_at":"2020-06-13T21:28:03.000Z","dependencies_parsed_at":"2024-03-08T09:01:52.991Z","dependency_job_id":null,"html_url":"https://github.com/joncloud/net-http-perf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fnet-http-perf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fnet-http-perf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fnet-http-perf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncloud%2Fnet-http-perf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joncloud","download_url":"https://codeload.github.com/joncloud/net-http-perf/tar.gz/refs/heads/publish","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243360781,"owners_count":20278435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T13:32:24.223Z","updated_at":"2025-12-24T18:40:51.610Z","avatar_url":"https://github.com/joncloud.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET HTTP Performance Test\nThis project tests the performance of the `HttpClient` and `HttpWebRequest` classes using both .NET Framework and .NET Core.\n\n## Requirements\n.NET Framework 4.6.1 SDK or Mono 5.2\n.NET Core SDK 2.0\n\n## Implementation\nThe solution is made up of three types of projects:\n* App - Console application executing all Library tests using BenchmarkDotNet\n* Library - Library that exposes a class responsible for testing `HttpClient` and `HttpWebRequest`\n* Reflector - Web application that simply echoes a request's body as the response's body\n\nThe `App` and `Library` projects are configured for both `net461` and `netcoreapp20`/`netstandard20`.\n\n## Tests\nMake sure that `dotnet` is available in the CLI `PATH` environment variable prior to executing.  The test will output the current test run into the `./results` directory, as well as `stdout`.\n\n### Windows Tests\nUsing PowerShell execute `run.ps1`.\n\n### Linux Tests\nIn order to run tests on Linux the environment variable `FrameworkPathOverride` must be specified to the `net461` API path.  See [dotnet/sdk Issue #335](https://github.com/dotnet/sdk/issues/335#issuecomment-324431853) for more information.\nUsing Bash execute `run.sh`.\n\n## Results\nThe results show that `HttpWebRequest` degrades in performance significantly when running under .NET Core.\n\n### Windows Azure VM\n```powershell\ndotnet --info\n.NET Command Line Tools (2.0.0)\n\nProduct Information:\n Version:            2.0.0\n Commit SHA-1 hash:  cdcd1928c9\n\nRuntime Environment:\n OS Name:     Windows\n OS Version:  10.0.15063\n OS Platform: Windows\n RID:         win10-x64\n Base Path:   C:\\Program Files\\dotnet\\sdk\\2.0.0\\\n\nMicrosoft .NET Core Shared Framework Host\n\n  Version  : 2.0.0\n  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d\n```\n\n#### App.Net461\n``` ini\nBenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063)\nProcessor=Intel Xeon CPU E5-2673 v3 2.40GHzIntel Xeon CPU E5-2673 v3 2.40GHz, ProcessorCount=20\n  [Host]     : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2102.0\n  DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2102.0\n```\n |                       Method |     Mean |    Error |   StdDev | Scaled | ScaledSD |  Gen 0 | Allocated |\n |----------------------------- |---------:|---------:|---------:|-------:|---------:|-------:|----------:|\n |            Net461_HttpClient | 640.1 us | 12.80 us | 33.94 us |   1.00 |     0.00 | 3.4180 |  22.15 KB |\n |        Net461_HttpWebRequest | 584.6 us | 11.66 us | 19.16 us |   0.92 |     0.06 | 0.9766 |  19.62 KB |\n |     NetStandard20_HttpClient | 770.0 us | 18.23 us | 53.74 us |   1.21 |     0.10 | 2.9297 |  21.99 KB |\n | NetStandard20_HttpWebRequest | 816.9 us | 16.11 us | 34.32 us |   1.28 |     0.09 | 0.9766 |  19.62 KB |\n\n#### App.NetCoreApp20\n``` ini\nBenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063)\nProcessor=Intel Xeon CPU E5-2673 v3 2.40GHz, ProcessorCount=20\n.NET Core SDK=2.0.0\n  [Host]     : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT\n  DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT\n```\n |                       Method |       Mean |    Error |   StdDev |     Median | Scaled | ScaledSD | Allocated |\n |----------------------------- |-----------:|---------:|---------:|-----------:|-------:|---------:|----------:|\n |            Net461_HttpClient |   571.6 us | 12.58 us | 37.10 us |   554.7 us |   1.00 |     0.00 |   2.24 KB |\n |        Net461_HttpWebRequest | 2,835.8 us | 36.56 us | 34.20 us | 2,841.7 us |   4.98 |     0.31 |  15.77 KB |\n |     NetStandard20_HttpClient |   770.3 us | 15.39 us | 41.07 us |   789.1 us |   1.35 |     0.11 |   2.24 KB |\n | NetStandard20_HttpWebRequest | 2,698.2 us | 18.89 us | 16.74 us | 2,695.9 us |   4.74 |     0.29 |  15.77 KB |\n\n### Windows MBP\n```powershell\ndotnet --info\n.NET Command Line Tools (2.0.0)\n\nProduct Information:\n Version:            2.0.0\n Commit SHA-1 hash:  cdcd1928c9\n\nRuntime Environment:\n OS Name:     Windows\n OS Version:  10.0.15063\n OS Platform: Windows\n RID:         win10-x64\n Base Path:   C:\\Program Files\\dotnet\\sdk\\2.0.0\\\n\nMicrosoft .NET Core Shared Framework Host\n\n  Version  : 2.0.0\n  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d\n```\n\n#### App.Net461\n``` ini\nBenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063)\nProcessor=Intel Core i5-4258U CPU 2.40GHz (Haswell), ProcessorCount=4\nFrequency=2343750 Hz, Resolution=426.6667 ns, Timer=TSC\n  [Host]     : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2102.0\n  DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2102.0\n```\n |                       Method |       Mean |    Error |    StdDev | Scaled | ScaledSD |   Gen 0 | Allocated |\n |----------------------------- |-----------:|---------:|----------:|-------:|---------:|--------:|----------:|\n |            Net461_HttpClient | 1,336.9 us | 56.36 us | 158.97 us |   1.00 |     0.00 | 14.6484 |   23.1 KB |\n |        Net461_HttpWebRequest | 1,127.4 us | 22.29 us |  61.03 us |   0.85 |     0.11 | 12.6953 |   19.7 KB |\n |     NetStandard20_HttpClient |   891.3 us | 29.04 us |  79.02 us |   0.68 |     0.10 | 14.6484 |  23.11 KB |\n | NetStandard20_HttpWebRequest |   713.2 us | 15.79 us |  45.31 us |   0.54 |     0.07 | 12.6953 |   19.7 KB |\n\n#### App.NetCoreApp20\n ``` ini\nBenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063)\nProcessor=Intel Core i5-4258U CPU 2.40GHz (Haswell), ProcessorCount=4\nFrequency=2343750 Hz, Resolution=426.6667 ns, Timer=TSC\n.NET Core SDK=2.0.0\n  [Host]     : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT\n  DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT\n```\n |                       Method |       Mean |     Error |      StdDev |     Median | Scaled | ScaledSD |  Gen 0 | Allocated |\n |----------------------------- |-----------:|----------:|------------:|-----------:|-------:|---------:|-------:|----------:|\n |            Net461_HttpClient | 1,015.0 us |  20.03 us |    43.12 us | 1,010.5 us |   1.00 |     0.00 | 3.9063 |   2.24 KB |\n |        Net461_HttpWebRequest | 9,202.3 us | 541.78 us | 1,588.93 us | 8,374.9 us |   9.08 |     1.61 |      - |  15.52 KB |\n |     NetStandard20_HttpClient |   916.5 us |  18.16 us |    46.56 us |   919.4 us |   0.90 |     0.06 | 3.9063 |   2.24 KB |\n | NetStandard20_HttpWebRequest | 4,822.5 us | 125.25 us |   123.01 us | 4,830.6 us |   4.76 |     0.23 | 7.8125 |  15.52 KB |\n\n### Linux Debian 9\n```bash\ndotnet --info\n.NET Command Line Tools (2.0.0)\n\nProduct Information:\n Version:            2.0.0\n Commit SHA-1 hash:  cdcd1928c9\n\nRuntime Environment:\n OS Name:     debian\n OS Version:  9\n OS Platform: Linux\n RID:         linux-x64\n Base Path:   /home/jdberube/.dotnet/sdk/2.0.0/\n\nMicrosoft .NET Core Shared Framework Host\n\n  Version  : 2.0.0\n  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d\n\nmono --version\nMono JIT compiler version 5.2.0.215 (tarball Mon Aug 14 15:44:25 UTC 2017)\nCopyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com\n        TLS:           __thread\n        SIGSEGV:       altstack\n        Notifications: epoll\n        Architecture:  amd64\n        Disabled:      none\n        Misc:          softdebug\n        LLVM:          supported, not enabled.\n        GC:            sgen (concurrent by default)\n```\n#### App.Net461\n``` ini\nBenchmarkDotNet=v0.10.9, OS=debian 9\nProcessor=Intel Core i5-2400 CPU 3.10GHz (Sandy Bridge), ProcessorCount=4\n  [Host]     : Mono 5.2.0.215 (tarball Mon), 64bit\n  DefaultJob : Mono 5.2.0.215 (tarball Mon), 64bit\n```\n |                       Method |     Mean |    Error |   StdDev | Scaled | ScaledSD |  Gen 0 | Allocated |\n |----------------------------- |---------:|---------:|---------:|-------:|---------:|-------:|----------:|\n |            Net461_HttpClient |       NA |       NA |       NA |      ? |        ? |    N/A |       N/A |\n |        Net461_HttpWebRequest | 330.2 us | 3.492 us | 3.096 us |      ? |        ? | 6.1035 |       0 B |\n |     NetStandard20_HttpClient |       NA |       NA |       NA |      ? |        ? |    N/A |       N/A |\n | NetStandard20_HttpWebRequest | 335.0 us | 2.963 us | 2.627 us |      ? |        ? | 5.8594 |       0 B |\n\nBenchmarks with issues:\n* Program.Net461_HttpClient: DefaultJob\n* Program.NetStandard20_HttpClient: DefaultJob\n\n#### App.NetCoreApp20\n``` ini\nBenchmarkDotNet=v0.10.9, OS=debian 9\nProcessor=Intel Core i5-2400 CPU 3.10GHz (Sandy Bridge), ProcessorCount=4\n.NET Core SDK=2.0.0\n  [Host]     : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT\n  DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT\n```\n |                       Method |     Mean |    Error |   StdDev |   Median | Scaled | ScaledSD |  Gen 0 | Allocated |\n |----------------------------- |---------:|---------:|---------:|---------:|-------:|---------:|-------:|----------:|\n |            Net461_HttpClient | 272.3 us | 12.46 us | 35.94 us | 260.1 us |   1.00 |     0.00 | 1.9531 |    2600 B |\n |        Net461_HttpWebRequest |       NA |       NA |       NA |       NA |      ? |        ? |    N/A |       N/A |\n |     NetStandard20_HttpClient | 271.7 us | 14.37 us | 41.23 us | 258.5 us |   1.01 |     0.20 | 1.9531 |    2600 B |\n | NetStandard20_HttpWebRequest |       NA |       NA |       NA |       NA |      ? |        ? |    N/A |       N/A |\n\nBenchmarks with issues:\n* Program.Net461_HttpWebRequest: DefaultJob\n* Program.NetStandard20_HttpWebRequest: DefaultJob","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncloud%2Fnet-http-perf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoncloud%2Fnet-http-perf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncloud%2Fnet-http-perf/lists"}