{"id":21526320,"url":"https://github.com/linxgnu/fimap","last_synced_at":"2025-03-17T18:34:13.252Z","repository":{"id":57485162,"uuid":"174944560","full_name":"linxGnu/fimap","owner":"linxGnu","description":"Fast map which takes uint64 as key.","archived":false,"fork":false,"pushed_at":"2023-06-05T06:01:25.000Z","size":23,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-24T05:41:44.706Z","etag":null,"topics":["fast","golang","key-value","map","uint64"],"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/linxGnu.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":"2019-03-11T07:08:15.000Z","updated_at":"2023-02-21T02:34:05.000Z","dependencies_parsed_at":"2024-06-20T15:30:43.767Z","dependency_job_id":"19c4896b-184c-43c0-a278-fd907b31e408","html_url":"https://github.com/linxGnu/fimap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxGnu%2Ffimap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxGnu%2Ffimap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxGnu%2Ffimap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxGnu%2Ffimap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linxGnu","download_url":"https://codeload.github.com/linxGnu/fimap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244089361,"owners_count":20396241,"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":["fast","golang","key-value","map","uint64"],"created_at":"2024-11-24T01:44:36.511Z","updated_at":"2025-03-17T18:34:13.199Z","avatar_url":"https://github.com/linxGnu.png","language":"Go","readme":"# fimap\n\n[![Build Status](https://travis-ci.org/linxGnu/fimap.svg?branch=master)](https://travis-ci.org/linxGnu/fimap)\n[![Go Report Card](https://goreportcard.com/badge/github.com/linxGnu/fimap)](https://goreportcard.com/report/github.com/linxGnu/fimap)\n[![Coverage Status](https://coveralls.io/repos/github/linxGnu/fimap/badge.svg?branch=master)](https://coveralls.io/github/linxGnu/fimap?branch=master)\n[![godoc](https://img.shields.io/badge/docs-GoDoc-green.svg)](https://godoc.org/github.com/linxGnu/fimap)\n\nA fast map that uses `uint64` for the index key and `interface{}` for the data, based on http://java-performance.info/implementing-world-fastest-java-int-to-int-hash-map/\n\nIt is 1.5-2X faster than the builtin map.\n\n### Installing\n\nTo start using `fimap`, install Go and run `go get`:\n\n```\ngo get -u github.com/linxGnu/fimap\n```\n\n### Example\n\n```go\nimport \"github.com/linxGnu/fimap\"\n\n// 1000: expect capacity\n// 0.5: threshold. When cardinality \u003e= threshold * capacity\n// the map would grow 2x\ns, _ := fimap.New(1000, 0.5) \n\n// set\ns.Set(123, struct{}{})\ns.Set(345, 128)\n\n// get\nv, exist := s.Get(123)\n\n// get number of elements in map\ns.Size()\n\n// create new map and clone from orginal\nc := s.Clone()\n\n// iterate\ns.Iterate(func(key uint64, value interface{}) error {\n  // do some thing with key value\n  return nil // return non nil error if you want to stop iteration\n})\n```\n\n### Benchmark\n```scala\nsystem_profiler SPHardwareDataType\n\nHardware:\n\n    Hardware Overview:\n\n      Model Name: MacBook Pro\n      Model Identifier: MacBookPro14,3\n      Processor Name: Intel Core i7\n      Processor Speed: 2.8 GHz\n      Number of Processors: 1\n      Total Number of Cores: 4\n      L2 Cache (per Core): 256 KB\n      L3 Cache: 6 MB\n      Memory: 16 GB\n      Boot ROM Version: 185.0.0.0.0\n      SMC Version (system): 2.45f0\n```\n\n```scala\ngoos: darwin\ngoarch: amd64\npkg: github.com/linxGnu/fimap\nBenchmarkFIMapSmall-8              22826             52884 ns/op           98368 B/op         23 allocs/op\nBenchmarkFIMapMedium-8                 5         235211344 ns/op        201326656 B/op        45 allocs/op\nBenchmarkFIMapLarge-8                  1        1515300167 ns/op        805306432 B/op        49 allocs/op\nBenchmarkMapSmall-8                13306             89721 ns/op           47813 B/op         65 allocs/op\nBenchmarkMapMedium-8                   3         406576060 ns/op        99906680 B/op      76844 allocs/op\nBenchmarkMapLarge-8                    1        2055357735 ns/op        403988760 B/op    306818 allocs/op\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinxgnu%2Ffimap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinxgnu%2Ffimap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinxgnu%2Ffimap/lists"}