{"id":16746969,"url":"https://github.com/selfup/tinymap","last_synced_at":"2025-07-24T14:07:04.948Z","repository":{"id":57552269,"uuid":"162532640","full_name":"selfup/tinymap","owner":"selfup","description":"Provides a simple to use interface that behaves like a HashMap. Primarily made for tinygo :tada:","archived":false,"fork":false,"pushed_at":"2019-01-06T04:45:49.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T02:27:01.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/selfup/tinymap","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/selfup.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}},"created_at":"2018-12-20T05:49:13.000Z","updated_at":"2019-01-06T04:45:51.000Z","dependencies_parsed_at":"2022-09-26T18:50:38.192Z","dependency_job_id":null,"html_url":"https://github.com/selfup/tinymap","commit_stats":null,"previous_names":["selfup/tiny_map"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/selfup/tinymap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Ftinymap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Ftinymap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Ftinymap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Ftinymap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfup","download_url":"https://codeload.github.com/selfup/tinymap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Ftinymap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266854486,"owners_count":23995485,"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-07-24T02:00:09.469Z","response_time":99,"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-13T02:08:46.470Z","updated_at":"2025-07-24T14:07:04.896Z","avatar_url":"https://github.com/selfup.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/selfup/tinymap?status.svg)](https://godoc.org/github.com/selfup/tinymap)\n[![Build Status](https://travis-ci.org/selfup/tinymap.svg?branch=master)](https://travis-ci.org/selfup/tinymap)\n\n# tinymap\n\nProvides a simple to use interface that behaves like a `HashMap`.\n\nMultiple `Maps` are exposed for use as well as structs that behave like `Tuples`.\n\nThis package is intended to be used with `tinygo`.\n\nHowever it has some nice little structs, so feel free to use this as you wish.\n\nIt is very small, but helps with embedded programming.\n\n:tada:\n\n### Basic usage\n\nJust one of the many Maps :smile:\n\n```go\nstrMap := new(StrMap)\n\nstrMap.Set(\"foo\", \"bar\")\n\nval, err := strMap.Get(\"foo\")\n\nif err != nil {\n  log.Print(err)\n}\n\nfmt.Print(val)\n\nstrMap.Delete(\"foo\")\n```\n\n### Benchmarks\n\n```ocaml\n$ ./scripts/bench.sh\n+ go test -bench=.\ngoos: windows\ngoarch: amd64\npkg: github.com/selfup/tinymap\nBenchmark_ByteMap_Get_Lower_Bound-4             50000000                25.7 ns/op\nBenchmark_ByteMap_Get_Expected_Bound-4          50000000                29.3 ns/op\nBenchmark_ByteMap_Get_Upper_Bound-4              3000000               530 ns/op\nBenchmark_ByteMap_Set_Upper_Bound-4              5000000               302 ns/op\nBenchmark_ByteMap_Delete_Upper_Bound-4          100000000               11.7 ns/op\nBenchmark_IntMap_Get_Lower_Bound-4              1000000000               2.51 ns/op\nBenchmark_IntMap_Get_Expected_Bound-4           300000000                4.19 ns/op\nBenchmark_IntMap_Get_Upper_Bound-4              30000000                45.3 ns/op\nBenchmark_IntMap_Set_Upper_Bound-4              1000000000               2.84 ns/op\nBenchmark_IntMap_Delete_Upper_Bound-4           1000000000               2.09 ns/op\nBenchmark_IntStrMap_Get_Lower_Bound-4           1000000000               2.69 ns/op\nBenchmark_IntStrMap_Get_Expected_Bound-4        300000000                4.84 ns/op\nBenchmark_IntStrMap_Get_Upper_Bound-4           30000000                55.8 ns/op\nBenchmark_IntStrMap_Set_Upper_Bound-4           100000000               20.1 ns/op\nBenchmark_IntStrMap_Delete_Upper_Bound-4        1000000000               2.07 ns/op\nBenchmark_StrByteMap_Get_Lower_Bound-4          200000000                6.91 ns/op\nBenchmark_StrByteMap_Get_Expected_Bound-4       100000000               14.8 ns/op\nBenchmark_StrByteMap_Get_Upper_Bound-4           3000000               444 ns/op\nBenchmark_StrByteMap_Set_Upper_Bound-4           5000000               253 ns/op\nBenchmark_StrByteMap_Delete_Upper_Bound-4       200000000                6.45 ns/op\nBenchmark_StrMap_Get_Lower_Bound-4              300000000                4.86 ns/op\nBenchmark_StrMap_Get_Expected_Bound-4           300000000                4.95 ns/op\nBenchmark_StrMap_Get_Upper_Bound-4               5000000               325 ns/op\nBenchmark_StrMap_Set_Upper_Bound-4              10000000               196 ns/op\nBenchmark_StrMap_Delete_Upper_Bound-4           200000000                6.33 ns/op\nPASS\nok      github.com/selfup/tinymap       49.282s\n```\n\n### Details\n\n1. Using an int as an index is fastest for lookups/comparisons.\n1. Using []byte as key is the slowest (makes sense)\n1. Lower Bound means the value being grabbed is the 1th element in a slice of 1 element.\n1. Expected Bound means the value is being grabbed at the 5th element in a slice of 5 elements.\n1. Upper Bound means the value being grabbed is the 100th element in a slice of 100 elements.\n1. Under the hood TinyMap uses slices to store Tuples.\n1. I have not yet added a catch block to prevent the slice to grow, but this should be used for small data sotrage :pray:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfup%2Ftinymap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfup%2Ftinymap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfup%2Ftinymap/lists"}