{"id":22038677,"url":"https://github.com/utkusen/goroutine-benchmark","last_synced_at":"2026-03-09T17:46:17.254Z","repository":{"id":213379476,"uuid":"733957385","full_name":"utkusen/goroutine-benchmark","owner":"utkusen","description":"runs benchmarks to determine the optimal number of Go routine pool size on the current machine","archived":false,"fork":false,"pushed_at":"2023-12-20T15:24:11.000Z","size":6,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T01:46:06.885Z","etag":null,"topics":["go","golang","goroutine","goroutine-pool","worker-pool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utkusen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-20T14:20:44.000Z","updated_at":"2023-12-21T06:44:10.000Z","dependencies_parsed_at":"2023-12-20T17:47:04.762Z","dependency_job_id":"f6b7dabf-da56-417b-9f4e-8d0c192e15fb","html_url":"https://github.com/utkusen/goroutine-benchmark","commit_stats":null,"previous_names":["utkusen/goroutine-benchmark"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkusen%2Fgoroutine-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkusen%2Fgoroutine-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkusen%2Fgoroutine-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkusen%2Fgoroutine-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utkusen","download_url":"https://codeload.github.com/utkusen/goroutine-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227324043,"owners_count":17764604,"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":["go","golang","goroutine","goroutine-pool","worker-pool"],"created_at":"2024-11-30T11:07:19.838Z","updated_at":"2026-03-09T17:46:12.204Z","avatar_url":"https://github.com/utkusen.png","language":"Go","readme":"# goroutine-benchmark\n\nRunning concurrent Go routines is an effective way to maximize the performance of multi-core processors. If you have undefined amount of tasks, it’s better to limit number of running go routines with a pool mechanism. However, determining this limit is not straightforward. It usually does not equal to the number of processors and can vary between CPU-related and network-related tasks.\n\nThis tool allows you to benchmark your current system to identify the optimal number of go routines. It tests both CPU-related and network-related tasks.\n\n# Installation\n\n## From Binary\n\nYou can download the pre-built binaries from the [releases](https://github.com/utkusen/goroutine-benchmark/releases/latest) page and run. For example:\n\n`unzip goroutine-benchmark-linux-amd64.zip`\n\n`./goroutine-benchmark --help`\n\n## From Source\n\n1) Install Go on your system\n\n2) Run: `go install github.com/utkusen/goroutine-benchmark@latest`\n\n# Usage\n\nYou can run it with default values\n\n`./goroutine-benchmark`\n\nIt will produce a result like:\n\n```\nStarting CPU tests...\n[CPU] Pool size: 2, Time taken: 30.906672859s\n[CPU] Pool size: 3, Time taken: 21.174364486s\n[CPU] Pool size: 4, Time taken: 14.614268344s\n[CPU] Pool size: 5, Time taken: 12.463523168s\n[CPU] Pool size: 6, Time taken: 10.923756879s\n[CPU] Pool size: 7, Time taken: 9.343834108s\n[CPU] Pool size: 8, Time taken: 8.111060596s\n[CPU] Pool size: 9, Time taken: 7.547088552s\n[CPU] Pool size: 10, Time taken: 6.669233083s\n[CPU] Pool size: 11, Time taken: 7.255197785s\n[CPU] Sweet spot found at pool size: 10\n\nStarting HTTP tests...\n[HTTP] Pool size: 2, Time taken: 46.302199477s\n[HTTP] Pool size: 7, Time taken: 13.294319729s\n[HTTP] Pool size: 12, Time taken: 7.771916167s\n[HTTP] Pool size: 17, Time taken: 5.541366266s\n[HTTP] Pool size: 22, Time taken: 4.247880245s\n[HTTP] Pool size: 27, Time taken: 3.525955192s\n[HTTP] Pool size: 32, Time taken: 2.968827238s\n[HTTP] Pool size: 37, Time taken: 2.589811276s\n[HTTP] Pool size: 42, Time taken: 2.252026786s\n[HTTP] Pool size: 47, Time taken: 2.037507483s\n[HTTP] Pool size: 52, Time taken: 1.851666206s\n[HTTP] Pool size: 57, Time taken: 1.676372247s\n[HTTP] Pool size: 62, Time taken: 1.637649876s\n[HTTP] Pool size: 67, Time taken: 1.481247566s\n[HTTP] Pool size: 72, Time taken: 1.321769664s\n[HTTP] Pool size: 77, Time taken: 1.300674719s\n[HTTP] Sweet spot found at pool size: 76\n```\n\nYou can also fine-tune different parameters:\n\n```\n  -cpu-steps int\n    \tSteps to increase Go routine pool size (default 1)\n  -cpu-task int\n    \tTotal CPU tasks (default 50)\n  -cpu-threshold float\n    \tSuccess threshold for CPU-intensive tasks (percentage) (default 1)\n  -fib int\n    \tFibonacci number to calculate (default 40)\n  -http-steps int\n    \tSteps to increase Go routine pool size (default 5)\n  -http-task int\n    \tTotal HTTP requests for each pool size (default 500)\n  -http-threshold float\n    \tSuccess threshold for HTTP tasks (percentage) (default 1)\n  -url string\n    \tTarget URL to send HTTP requests (default \"http://example.com\")\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkusen%2Fgoroutine-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futkusen%2Fgoroutine-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkusen%2Fgoroutine-benchmark/lists"}