{"id":13616244,"url":"https://github.com/dolthub/swiss","last_synced_at":"2025-03-09T01:23:38.527Z","repository":{"id":149052646,"uuid":"605730550","full_name":"dolthub/swiss","owner":"dolthub","description":"Golang port of Abseil's SwissTable","archived":false,"fork":false,"pushed_at":"2024-07-04T11:15:38.000Z","size":36,"stargazers_count":819,"open_issues_count":15,"forks_count":42,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-01T00:54:14.478Z","etag":null,"topics":["abseil","asm","collection","data-structures","generics","golang","hashmap","hashtable","sse3","swisstable"],"latest_commit_sha":null,"homepage":"","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/dolthub.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":"2023-02-23T19:28:25.000Z","updated_at":"2025-02-27T09:24:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"14e49356-cd43-48bc-a586-2b09a3370962","html_url":"https://github.com/dolthub/swiss","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fswiss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fswiss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fswiss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fswiss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolthub","download_url":"https://codeload.github.com/dolthub/swiss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242629459,"owners_count":20160596,"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":["abseil","asm","collection","data-structures","generics","golang","hashmap","hashtable","sse3","swisstable"],"created_at":"2024-08-01T20:01:25.760Z","updated_at":"2025-03-09T01:23:38.520Z","avatar_url":"https://github.com/dolthub.png","language":"Go","readme":"# This Repository Is Archived\n\nThis repository has been archived. Go 1.24+ uses swiss tables for its native maps. Please see [our announcement blog about our decision to archive `dolthub/swiss`](https://www.dolthub.com/blog/2025-03-07-archiving-the-dolthub-swiss-github-repository/).\n\n# SwissMap\n\nSwissMap is a hash table adapated from the \"SwissTable\" family of hash tables from [Abseil](https://abseil.io/blog/20180927-swisstables). It uses [AES](https://github.com/dolthub/maphash) instructions for fast-hashing and performs key lookups in parallel using [SSE](https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions) instructions. Because of these optimizations, SwissMap is faster and more memory efficient than Golang's built-in `map`. If you'd like to learn more about its design and implementation, check out this [blog post](https://www.dolthub.com/blog/2023-03-28-swiss-map/) announcing its release.\n\n\n## Example\n\nSwissMap exposes the same interface as the built-in `map`. Give it a try using this [Go playground](https://go.dev/play/p/JPDC5WhYN7g).\n\n```go\npackage main\n\nimport \"github.com/dolthub/swiss\"\n\nfunc main() {\n\tm := swiss.NewMap[string, int](42)\n\n\tm.Put(\"foo\", 1)\n\tm.Put(\"bar\", 2)\n\n\tm.Iter(func(k string, v int) (stop bool) {\n\t\tprintln(\"iter\", k, v)\n\t\treturn false // continue\n\t})\n\n\tif x, ok := m.Get(\"foo\"); ok {\n\t\tprintln(x)\n\t}\n\tif m.Has(\"bar\") {\n\t\tx, _ := m.Get(\"bar\")\n\t\tprintln(x)\n\t}\n\n\tm.Put(\"foo\", -1)\n\tm.Delete(\"bar\")\n\n\tif x, ok := m.Get(\"foo\"); ok {\n\t\tprintln(x)\n\t}\n\tif m.Has(\"bar\") {\n\t\tx, _ := m.Get(\"bar\")\n\t\tprintln(x)\n\t}\n\n\tm.Clear()\n\n\t// Output:\n\t// iter foo 1\n\t// iter bar 2\n\t// 1\n\t// 2\n\t// -1\n}\n```\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolthub%2Fswiss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolthub%2Fswiss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolthub%2Fswiss/lists"}