{"id":19302846,"url":"https://github.com/sapvs/perf-go","last_synced_at":"2026-05-20T07:38:49.428Z","repository":{"id":59883192,"uuid":"539827893","full_name":"sapvs/perf-go","owner":"sapvs","description":"Benchmarks of different approaches for common problem in go","archived":false,"fork":false,"pushed_at":"2025-07-05T08:30:50.000Z","size":3872,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T09:19:06.375Z","etag":null,"topics":["algorithms","atomic","benchmark","counter","factorial","fibonacci","fizzbuzz","go","golang","json","prime-numbers","protobuf","xml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/sapvs.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-22T06:17:23.000Z","updated_at":"2025-07-05T08:30:49.000Z","dependencies_parsed_at":"2024-03-14T09:52:18.319Z","dependency_job_id":"625013d8-001d-4967-b70c-88c9e7af7924","html_url":"https://github.com/sapvs/perf-go","commit_stats":null,"previous_names":["s3vt/perf-go","sapvs/perf-go","vsapan/perf-go"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sapvs/perf-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapvs%2Fperf-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapvs%2Fperf-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapvs%2Fperf-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapvs%2Fperf-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sapvs","download_url":"https://codeload.github.com/sapvs/perf-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapvs%2Fperf-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265076052,"owners_count":23707511,"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":["algorithms","atomic","benchmark","counter","factorial","fibonacci","fizzbuzz","go","golang","json","prime-numbers","protobuf","xml"],"created_at":"2024-11-09T23:23:59.926Z","updated_at":"2026-05-20T07:38:49.421Z","avatar_url":"https://github.com/sapvs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go](https://github.com/sapvs/perf-go/actions/workflows/go.yml/badge.svg)](https://github.com/sapvs/perf-go/actions/workflows/go.yml)\n\n# perf-go\nBenchmarks of different approaches for common problem in go\n\n## Run tests\n```\nmake\n```\n\n## Results (On my PC ;) )\n\n### Counter problem using [sync.atomic](https://pkg.go.dev/sync/atomic) versus [sync.mutex](https://pkg.go.dev/sync#Mutex)\n|Counter|Total|ns/op|\n|-|-:|-:|\n|BenchmarkCounterAtomic-4|69815256|18.02|\n|BenchmarkCounterMutex-4|24769442|46.93|\n\n### Factorial recursive vs serial\n|Factorial|Total|ns/op|\n|-|-:|-:|\n|BenchmarkFactorialSerial/FactorialSerial-20-4|113081472|10.46|\n|BenchmarkFactorialSerial/FactorialRecursive-20-4|27576867|40.32|\n|BenchmarkFactorialParallel/FactorialSerial-20-4|276191018|4.326|\n|BenchmarkFactorialParallel/FactorialRecursive-20-4|72123966|15.11|\n\n### Fibonacci Classic vs DP\n|Fibbonacci|Total|ns/op|\n|-|-:|-:|\n|BenchmarkFibonnaciSerial/FibonacciSumClassic-20-4|31941|37669|\n|BenchmarkFibonnaciSerial/FibonacciSumDP-20-4|59457067|18.42|\n|BenchmarkFibbonacciParallel-4|75055|15622|\n\n### Fizzbuzz three approaches\n|FizzBuzz|Total|ns/op|\n|-|-:|-:|\n|BenchmarkFizzBuzzSer/v1-1-4|290979|3659|\n|BenchmarkFizzBuzzSer/v2-1-4|250216|5175|\n|BenchmarkFizzBuzzSer/v3-1-4|262671|4178|\n|BenchmarkFizzBuzzPar/v1-1-4|526555|1991|\n|BenchmarkFizzBuzzPar/v2-1-4|480120|2218|\n|BenchmarkFizzBuzzPar/v3-1-4|494432|2205|\n\n### Check if number is prime, Three ways worst to best\n|Is Prime|Total|ns/op|\n|-|-:|-:|\n|BenchmarkIsPrimeSerial/PrimeV1-1-4|51702789|19.60|\n|BenchmarkIsPrimeSerial/PrimeV2-1-4|48296462|22.95|\n|BenchmarkIsPrimeSerial/PrimeV3-1-4|75659934|15.84|\n|BenchmarkIsPrimeParallel-4|49888394|21.62|\n\n\n### JSON vs XML Vs ProtoBuf\n|JSON vs XML|Total|ns/op|mem/op|alloc/op|\n|-|-:|-:|-:|-:|\n|BenchmarkToJSON-4|332880|3214|179|3|\n|BenchmarkToXML-4|99578|11726|4632|11|\n|BenchmarkFromJSON-4|167470|7137|312|7|\n|BenchmarkFromXML-4|46717|25749|1608|34|\n|BenchmarkParToXML-4|190856|6110|4632|11|\n|BenchmarkParToJSON-4|716979|1718|179|3|\n|BenchmarkParFromJSON-4|336836|3518|312|7|\n|BenchmarkParFromXML-4|74744|15033|1608|34|\n|BenchmarkToProto-4|6285468|175.3|80|2|\n|BenchmarkFromProto-4|5491707|211.5|72|2|\n|BenchmarkParToProto-4|10795147|100.6|80|2|\n|BenchmarkParFromProto-4|9810102|114.5|72|2|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapvs%2Fperf-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapvs%2Fperf-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapvs%2Fperf-go/lists"}