{"id":13827100,"url":"https://github.com/cornelk/go-benchmark","last_synced_at":"2025-04-09T06:06:04.559Z","repository":{"id":47572558,"uuid":"81716207","full_name":"cornelk/go-benchmark","owner":"cornelk","description":"Golang benchmarks used for optimizing code","archived":false,"fork":false,"pushed_at":"2025-03-08T22:50:33.000Z","size":196,"stargazers_count":326,"open_issues_count":1,"forks_count":17,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-02T04:45:30.033Z","etag":null,"topics":["benchmark","go","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cornelk.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":"2017-02-12T09:41:44.000Z","updated_at":"2025-03-10T06:25:31.000Z","dependencies_parsed_at":"2024-01-15T16:12:49.009Z","dependency_job_id":"941c53f8-a46b-46fd-9b22-ec37a24f7651","html_url":"https://github.com/cornelk/go-benchmark","commit_stats":{"total_commits":59,"total_committers":8,"mean_commits":7.375,"dds":0.2542372881355932,"last_synced_commit":"3af9b76afa3745835a519cfef3c3213ae80cb1c6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornelk%2Fgo-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornelk%2Fgo-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornelk%2Fgo-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornelk%2Fgo-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cornelk","download_url":"https://codeload.github.com/cornelk/go-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987184,"owners_count":21028891,"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":["benchmark","go","golang"],"created_at":"2024-08-04T09:01:50.025Z","updated_at":"2025-04-09T06:06:04.453Z","avatar_url":"https://github.com/cornelk.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-benchmark\n\nGolang benchmarks used for optimizing code. The benchmarks were run with Golang 1.24.0 and 64 bit CPU on Linux using `make benchmark-perflock`.\n\n## interface{} vs [unsafe.Pointer](https://golang.org/pkg/unsafe/#Pointer) \n\n```\nValueUnsafePointer-8          24.81n ±  3%\nValueInterface-8              233.9n ±  0%\n```\n\n## Using defer vs not using it\n\n```\nDefer-8                       228.3n ±  1%\nDeferNo-8                     145.6n ±  0%\n```\n\n## Iterating a slice\n\n```\nSliceReadRange-8              23.79n ±  3%\nSliceReadForward-8            23.82n ±  2%\nSliceReadBackwards-8          23.70n ±  1%\nSliceReadLastItemFirst-8      24.61n ±  3%\n```\n\n## Passing a parameter by value vs pointer\n\n```\nParameterPassedByPointer-8    12.01n ±  0%\nParameterPassedByValue-8      12.04n ±  0%\n```\n\n## Using reflect vs cast\n\n```\nReflect-8                     340.3n ±  0%\nCast-8                        240.9n ±  3%\n```\n\n## Hashing algorithms that produce a 64 bit hash of an 8 byte input\n\n```\nHashing64MD5-8                152.9n ±  0%\nHashing64SHA1-8               185.7n ±  0%\nHashing64SHA256-8             132.6n ±  1%\nHashing64SHA3B224-8           474.2n ±  1%\nHashing64SHA3B256-8           472.7n ±  1%\nHashing64RIPEMD160-8          389.0n ±  1%\nHashing64Blake2B-8            418.0n ±  1%\nHashing64Blake2BSimd-8        362.7n ±  1%\nHashing64Murmur3-8            58.68n ±  1%\nHashing64Murmur3Twmb-8        56.82n ±  1%\nHashing64SipHash-8            60.16n ±  1%\nHashing64XXHash-8             34.35n ±  2%\nHashing64XXHashpier-8         39.04n ±  1%\nHashing64HighwayHash-8        94.09n ±  1%\n```\n\n## Filling a slice by index or append\n\n```\nSliceFillByIndex-8            18.90n ±  0%\nSliceFillByIndexMake-8        18.94n ±  0%\nSliceFillMakeAppend-8         42.85n ±  0%\nSliceFillAppendNoMake-8       278.6n ±  6%\nSliceFillSmallMakeAppend-8    360.1n ±  7%\n```\n\n## Writing and reading an int atomic\n\n```\nAtomicInt32-8                 1.150µ ±  0%\nAtomicInt64-8                 1.140µ ±  0%\nAtomicUintptr-8               1.138µ ±  0%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcornelk%2Fgo-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcornelk%2Fgo-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcornelk%2Fgo-benchmark/lists"}