{"id":23255176,"url":"https://github.com/octu0/armap","last_synced_at":"2025-10-24T19:32:07.810Z","repository":{"id":264104426,"uuid":"892039130","full_name":"octu0/armap","owner":"octu0","description":"HashMap on Arena","archived":false,"fork":false,"pushed_at":"2024-11-25T09:26:38.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T07:04:10.440Z","etag":null,"topics":["arena-allocator","hashmap","hashset","linked-list"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/octu0/armap","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/octu0.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":"2024-11-21T12:04:00.000Z","updated_at":"2025-05-03T05:44:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"62842751-9f0d-4f1f-a6e1-f2e211161f15","html_url":"https://github.com/octu0/armap","commit_stats":null,"previous_names":["octu0/armap"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/octu0/armap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Farmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Farmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Farmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Farmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octu0","download_url":"https://codeload.github.com/octu0/armap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Farmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272186211,"owners_count":24888333,"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-08-26T02:00:07.904Z","response_time":60,"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":["arena-allocator","hashmap","hashset","linked-list"],"created_at":"2024-12-19T11:18:46.499Z","updated_at":"2025-10-24T19:32:02.777Z","avatar_url":"https://github.com/octu0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `armap`\n\n[![MIT License](https://img.shields.io/github/license/octu0/armap)](https://github.com/octu0/armap/blob/master/LICENSE)\n[![GoDoc](https://pkg.go.dev/badge/github.com/octu0/armap)](https://pkg.go.dev/github.com/octu0/armap)\n[![Go Report Card](https://goreportcard.com/badge/github.com/octu0/armap)](https://goreportcard.com/report/github.com/octu0/armap)\n[![Releases](https://img.shields.io/github/v/release/octu0/armap)](https://github.com/octu0/armap/releases)\n\nHashMap on [Arena](https://github.com/ortuman/nuke)\n\nfeatures:\n- [Generics](https://go.dev/doc/tutorial/generics) support\n- `Map` and `Set`, `LinkedList` types\n- Minimal GC overhead map implements\n- `comparable` key hash function uses [maphash](https://github.com/dolthub/maphash)\n\n## Installation\n\n```bash\ngo get github.com/octu0/armap\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/octu0/armap\"\n)\n\nfunc main() {\n\ta := armap.NewArena(1024*1024, 4) // 1MB buffer size * 4\n\tdefer a.Release() // release memory\n\n\tm := armap.NewMap[string, string](a, armap.WithCapacity(1000))\n\n\tm.Set(\"hello\", \"world1\")\n\tv, ok := m.Get(\"hello\")\n\tfmt.Println(v, ok) // =\u003e world1 true\n\n\tm.Set(\"hello\", \"world2\")\n\tv, ok = m.Get(\"hello\")\n\tfmt.Println(v, ok) // =\u003e world2 true\n\n\tm.Clear() // reset map, reuse memory\n\n\tv, ok = m.Get(\"hello\")\n\tfmt.Println(v, ok) // =\u003e \"\" false\n}\n```\n\n## GC Benchmark\n\naverage GC time improved by ~200x.\n\n```\n$ go test -run=BenchmarkGC -bench=BenchmarkGC -benchtime=3x -v .\ngoos: darwin\ngoarch: amd64\npkg: github.com/octu0/armap\ncpu: Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz\nBenchmarkGCSet\nBenchmarkGCSet/golangmap\n    armap_benchmark_test.go:92: min/avg/max/median = 59.526209ms/83.101306ms/270.682439ms/60.953085ms\n    armap_benchmark_test.go:92: min/avg/max/median = 59.485567ms/67.009433ms/125.832941ms/59.875661ms\nBenchmarkGCSet/golangmap-8         \t       3\t 223366544 ns/op\nBenchmarkGCSet/armap\n    armap_benchmark_test.go:117: min/avg/max/median = 216.152µs/377.403µs/507.442µs/377.907µs\n    armap_benchmark_test.go:117: min/avg/max/median = 291.639µs/354.231µs/576.287µs/314.844µs\nBenchmarkGCSet/armap-8             \t       3\t1353591775 ns/op\nPASS\n```\n\n# License\n\nMIT, see LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Farmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctu0%2Farmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Farmap/lists"}