{"id":21814313,"url":"https://github.com/snawoot/lfmap","last_synced_at":"2026-03-02T22:47:32.263Z","repository":{"id":254730350,"uuid":"847338733","full_name":"Snawoot/lfmap","owner":"Snawoot","description":"Generic concurrent lock-free map for Golang","archived":false,"fork":false,"pushed_at":"2024-08-31T23:40:40.000Z","size":17,"stargazers_count":44,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T13:51:26.643Z","etag":null,"topics":["concurrent-data-structure","concurrent-map","lock-free","lock-free-map","map"],"latest_commit_sha":null,"homepage":"","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/Snawoot.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-08-25T14:45:40.000Z","updated_at":"2025-01-27T04:58:16.000Z","dependencies_parsed_at":"2024-11-27T15:01:39.254Z","dependency_job_id":null,"html_url":"https://github.com/Snawoot/lfmap","commit_stats":null,"previous_names":["snawoot/lfmap"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Flfmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Flfmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Flfmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Flfmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snawoot","download_url":"https://codeload.github.com/Snawoot/lfmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799697,"owners_count":21163398,"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":["concurrent-data-structure","concurrent-map","lock-free","lock-free-map","map"],"created_at":"2024-11-27T14:37:37.474Z","updated_at":"2026-03-02T22:47:32.202Z","avatar_url":"https://github.com/Snawoot.png","language":"Go","readme":"# lfmap\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/Snawoot/lfmap.svg)](https://pkg.go.dev/github.com/Snawoot/lfmap)\n\nGeneric concurrent lock-free map for Golang.\n\nKey features:\n\n* `range` iteration over consistent snapshot of map without locking other threads and without copying all data in map to maintain that snapshot.\n* Convenient [transactions](https://pkg.go.dev/github.com/Snawoot/lfmap#Map.Transaction) where you can read-write multiple keys, check some conditions and make a change based on your logic. Compared to lfmap, `sync.Map` allows only CAS operations against single key and that's it.\n\n## Usage\n\nSee [godoc examples](https://pkg.go.dev/github.com/Snawoot/lfmap#pkg-examples).\n\n## Benchmarks\n\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/Snawoot/lfmap\ncpu: Intel(R) N100\nBenchmarkLFMapSet-4              \t  165698\t     11190 ns/op\nBenchmarkSyncMapSet-4            \t  857448\t      2302 ns/op\nBenchmarkLFMapGet-4              \t 3221922\t       365.1 ns/op\nBenchmarkSyncMapGet-4            \t 5302554\t       189.9 ns/op\nBenchmarkLFMapRange1000000-4     \t       8\t 142530076 ns/op\nBenchmarkSyncMapRange1000000-4   \t       7\t 150277709 ns/op\nPASS\nok  \tgithub.com/Snawoot/lfmap\t31.614s\n```\n\nSo far lfmap is 2-6 times slower than `sync.Map`, mostly because of underlying immutable ds performance. However, nice transactional properties may make it useful.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnawoot%2Flfmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnawoot%2Flfmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnawoot%2Flfmap/lists"}