{"id":20490227,"url":"https://github.com/juniormayhe/go-vs-netcore","last_synced_at":"2026-04-29T12:39:07.741Z","repository":{"id":115728197,"uuid":"223622540","full_name":"juniormayhe/go-vs-netcore","owner":"juniormayhe","description":"HTTP benchmark of reading mysql data with go and netcore","archived":false,"fork":false,"pushed_at":"2019-11-23T17:46:01.000Z","size":3316,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T05:24:36.990Z","etag":null,"topics":["gin","gin-gonic","go","golang","netcore2","netcore3","rest-api"],"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/juniormayhe.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":"2019-11-23T16:51:14.000Z","updated_at":"2022-06-01T14:07:33.000Z","dependencies_parsed_at":"2023-07-04T18:17:02.420Z","dependency_job_id":null,"html_url":"https://github.com/juniormayhe/go-vs-netcore","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/juniormayhe%2Fgo-vs-netcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniormayhe%2Fgo-vs-netcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniormayhe%2Fgo-vs-netcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniormayhe%2Fgo-vs-netcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juniormayhe","download_url":"https://codeload.github.com/juniormayhe/go-vs-netcore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242067803,"owners_count":20066771,"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":["gin","gin-gonic","go","golang","netcore2","netcore3","rest-api"],"created_at":"2024-11-15T17:16:07.038Z","updated_at":"2026-04-29T12:39:07.710Z","avatar_url":"https://github.com/juniormayhe.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Go vs Netcore REST API performance comparison\n\nHere a quick performance test using bombardier to evaluate requests per second, latency and throughput of go (with gin) and netcore.  \n\n![](https://media.giphy.com/media/wIV2gwOkpZeBG/giphy.gif)\n\n## Setup your enviroment\n\n### Prepare your mysql data\n```\ndocker pull mysql\ndocker run -p 3306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=12345 -d mysql:latest\n```\n\nthen create a demo database in mysql. Go project will create table automatically.\n\n### Download go dependencies for gin\n\n```\ncd ~/go/src/go\ngo get -u github.com/gin-gonic/gin\ngo get gopkg.in/gin-gonic/gin.v1\ngo get github.com/go-sql-driver/mysql\ngo get -u github.com/jinzhu/gorm\n```\n\n### Get benchmark tool\n```\ngo get -u github.com/codesenberg/bombardier\n```\n\n## Running go\n\nRun REST API in go before running bombardier for benchmarking go\n```\ngo run main.go\n```\n\n## Benchmarking\n\n### Golang 1.12.7\n```\n$ bombardier -c 125 -n 500000 http://localhost:8080/v1/api/todos\nBombarding http://localhost:8080/v1/api/todos with 500000 request(s) using 125 connection(s)\n 500000 / 500000  100.00% 2574/s 3m14s\nDone!\nStatistics        Avg      Stdev        Max\n  Reqs/sec      2577.86    1481.44    5601.18\n  Latency       48.50ms     3.76ms   304.00ms\n  HTTP codes:\n    1xx - 0, 2xx - 0, 3xx - 0, 4xx - 500000, 5xx - 0\n    others - 0\n  Throughput:   505.79KB/s\n```\n\n### Golang 1.13.4\n```\n$ bombardier -c 125 -n 500000 http://localhost:8080/v1/api/todos\nBombarding http://localhost:8080/v1/api/todos with 500000 request(s) using 125 connection(s)\n 500000 / 500000  100.00% 2634/s 3m9ss\nDone!\nStatistics        Avg      Stdev        Max\n  Reqs/sec      2637.04    1484.31    7012.62\n  Latency       47.41ms     4.74ms   318.00ms\n  HTTP codes:\n    1xx - 0, 2xx - 0, 3xx - 0, 4xx - 500000, 5xx - 0\n    others - 0\n  Throughput:   517.46KB/s\n```\n\n### Netcore 2.1\n\nUse Visual Studio or dotnet run to execute netcore REST api.\n\n```\n$ bombardier -c 125 -n 500000 http://localhost:5001/todo\nBombarding http://localhost:5001/todo with 500000 request(s) using 125 connectio   n(s)\n 500000 / 500000  100.00% 1362/s 6m7ss\nDone!\nStatistics        Avg      Stdev        Max\n  Reqs/sec      1362.85     845.11    6713.10\n  Latency       91.70ms    40.71ms      4.50s\n  HTTP codes:\n    1xx - 0, 2xx - 500000, 3xx - 0, 4xx - 0, 5xx - 0\n    others - 0\n  Throughput:   457.84KB/s\n```\n\n### Netcore 2.2\n```\n$ bombardier -c 125 -n 500000 http://localhost:5003/todo\nBombarding http://localhost:5003/todo with 500000 request(s) using 125 connection(s)\n 500000 / 500000  100.00% 1707/s 4m52s\nDone!\nStatistics        Avg      Stdev        Max\n  Reqs/sec      1708.14     883.62    6709.67\n  Latency       73.16ms    19.82ms      1.60s\n  HTTP codes:\n    1xx - 0, 2xx - 500000, 3xx - 0, 4xx - 0, 5xx - 0\n    others - 0\n  Throughput:   573.86KB/s\n```\n\n### Netcore 3.0\n```\n$ bombardier -c 125 -n 500000 http://localhost:5000/todo\nBombarding http://localhost:5000/todo with 500000 request(s) using 125 connection(s)\n 500000 / 500000  100.00% 1691/s 4m55s\nDone!\nStatistics        Avg      Stdev        Max\n  Reqs/sec      1691.85     847.78    6098.14\n  Latency       73.84ms   193.35ms      9.61s\n  HTTP codes:\n    1xx - 0, 2xx - 500000, 3xx - 0, 4xx - 0, 5xx - 0\n    others - 0\n  Throughput:   568.82KB/s\n```\n\n## TL;DR\n\nBest HTTP requests per second, higher is better\n\n| Language | Requests/sec |\n|  --- | ---:  |\n| go 1.13.4 | :arrow_up_small: 2637.04 |\n| go 1.12.7 | 2577.86 |\n| netcore 2.2 | 1708.14 |\n| netcore 3.0 | 1691.85 |\n| netcore 2.1 | 1362.85 |\n\nBest HTTP latency, lower is better\n\n| Language | ms |\n| --- | ---: |\n| go 1.13.4 | :arrow_up_small: 47.41 |\n| go 1.12.7 | 48.50 |\n| netcore 2.2 | 73.16 |\n| netcore 3.0 | 73.84 |\n| netcore 2.1 | 91.70 |\n\nBest HTTP throughput, higher is better\n  \n| Language  | KB/s |\n|--|---:|\n| netcore 2.2 | :arrow_up_small: 573.86 |\n| netcore 3.0 | 568.82 |\n| go 1.13.4 | 517.46 |\n| go 1.12.7 | 505.79 |\n| netcore 2.1 | 457.84 |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniormayhe%2Fgo-vs-netcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniormayhe%2Fgo-vs-netcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniormayhe%2Fgo-vs-netcore/lists"}