{"id":16112564,"url":"https://github.com/mhmtszr/concurrent-swiss-map","last_synced_at":"2025-10-06T20:26:42.561Z","repository":{"id":186271136,"uuid":"674916830","full_name":"mhmtszr/concurrent-swiss-map","owner":"mhmtszr","description":"A high-performance, thread-safe generic concurrent hash map implementation with Swiss Map.","archived":false,"fork":false,"pushed_at":"2024-12-04T05:39:18.000Z","size":389,"stargazers_count":244,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-26T08:55:49.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mhmtszr.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,"zenodo":null}},"created_at":"2023-08-05T06:47:51.000Z","updated_at":"2025-02-25T22:14:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4fef5c9-9148-4f7d-84aa-044638abbf77","html_url":"https://github.com/mhmtszr/concurrent-swiss-map","commit_stats":null,"previous_names":["mhmtszr/concurrent-swiss-map"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/mhmtszr/concurrent-swiss-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fconcurrent-swiss-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fconcurrent-swiss-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fconcurrent-swiss-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fconcurrent-swiss-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmtszr","download_url":"https://codeload.github.com/mhmtszr/concurrent-swiss-map/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fconcurrent-swiss-map/sbom","scorecard":{"id":640186,"data":{"date":"2025-08-11","repo":{"name":"github.com/mhmtszr/concurrent-swiss-map","commit":"726f60ce3da7081874637600f490ae72cdf7e003"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":2,"reason":"Found 8/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build-test.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:9","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/build-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/build-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-test.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/build-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-test.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/build-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/mhmtszr/concurrent-swiss-map/release.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   1 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T10:30:03.506Z","repository_id":186271136,"created_at":"2025-08-21T10:30:03.507Z","updated_at":"2025-08-21T10:30:03.507Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278673149,"owners_count":26026054,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09T20:08:28.341Z","updated_at":"2025-10-06T20:26:42.543Z","avatar_url":"https://github.com/mhmtszr.png","language":"Go","funding_links":[],"categories":["Go","Data Structures and Algorithms","数据结构与算法","Data Integration Frameworks"],"sub_categories":["Maps","地图"],"readme":"# Concurrent Swiss Map [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Go Report Card][go-report-img]][go-report]\n\n**Concurrent Swiss Map** is an open-source Go library that provides a high-performance, thread-safe generic concurrent hash map implementation designed to handle concurrent access efficiently. It's built with a focus on simplicity, speed, and reliability, making it a solid choice for scenarios where concurrent access to a hash map is crucial.\n\nUses [dolthub/swiss](https://github.com/dolthub/swiss) map implementation under the hood.\n\n## Installation\n\nSupports 1.18+ Go versions because of Go Generics\n\n```\ngo get github.com/mhmtszr/concurrent-swiss-map\n```\n\n## Usage\n\nNew functions will be added soon...\n\n```go\npackage main\n\nimport (\n\t\"hash/fnv\"\n\n\tcsmap \"github.com/mhmtszr/concurrent-swiss-map\"\n)\n\nfunc main() {\n\tmyMap := csmap.New[string, int](\n\t\t// set the number of map shards. the default value is 32.\n\t\tcsmap.WithShardCount[string, int](32),\n\n\t\t// if don't set custom hasher, use the built-in maphash.\n\t\tcsmap.WithCustomHasher[string, int](func(key string) uint64 {\n\t\t\thash := fnv.New64a()\n\t\t\thash.Write([]byte(key))\n\t\t\treturn hash.Sum64()\n\t\t}),\n\n\t\t// set the total capacity, every shard map has total capacity/shard count capacity. the default value is 0.\n\t\tcsmap.WithSize[string, int](1000),\n\t)\n\n\tkey := \"swiss-map\"\n\tmyMap.Store(key, 10)\n\n\tval, ok := myMap.Load(key)\n\tprintln(\"load val:\", val, \"exists:\", ok)\n\n\tdeleted := myMap.Delete(key)\n\tprintln(\"deleted:\", deleted)\n\n\tok = myMap.Has(key)\n\tprintln(\"has:\", ok)\n\n\tempty := myMap.IsEmpty()\n\tprintln(\"empty:\", empty)\n\n\tmyMap.SetIfAbsent(key, 11)\n\n\tmyMap.Range(func(key string, value int) (stop bool) {\n\t\tprintln(\"range:\", key, value)\n\t\treturn true\n\t})\n\n\tcount := myMap.Count()\n\tprintln(\"count:\", count)\n\n\t// Output:\n\t// load val: 10 exists: true\n\t// deleted: true\n\t// has: false\n\t// empty: true\n\t// range: swiss-map 11\n\t// count: 1\n}\n```\n\n## Basic Architecture\n![img.png](img.png)\n\n## Benchmark Test\nBenchmark was made on:\n- Apple M1 Max\n- 32 GB memory\n\nBenchmark test results can be obtained by running [this file](concurrent_swiss_map_benchmark_test.go) on local computers.\n\n![benchmark.png](benchmark.png)\n\n### Benchmark Results\n\n- Memory usage of the concurrent swiss map is better than other map implementations in all checked test scenarios.\n- In high concurrent systems, the concurrent swiss map is faster, but in systems containing few concurrent operations, it works similarly to RWMutexMap.\n\n[doc-img]: https://godoc.org/github.com/mhmtszr/concurrent-swiss-map?status.svg\n[doc]: https://godoc.org/github.com/mhmtszr/concurrent-swiss-map\n[ci-img]: https://github.com/mhmtszr/concurrent-swiss-map/actions/workflows/build-test.yml/badge.svg\n[ci]: https://github.com/mhmtszr/concurrent-swiss-map/actions/workflows/build-test.yml\n[cov-img]: https://codecov.io/gh/mhmtszr/concurrent-swiss-map/branch/master/graph/badge.svg\n[cov]: https://codecov.io/gh/mhmtszr/concurrent-swiss-map\n[go-report-img]: https://goreportcard.com/badge/github.com/mhmtszr/concurrent-swiss-map\n[go-report]: https://goreportcard.com/report/github.com/mhmtszr/concurrent-swiss-map","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmtszr%2Fconcurrent-swiss-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmtszr%2Fconcurrent-swiss-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmtszr%2Fconcurrent-swiss-map/lists"}