{"id":19431101,"url":"https://github.com/recoilme/art","last_synced_at":"2025-04-24T18:34:21.477Z","repository":{"id":42569273,"uuid":"509832511","full_name":"recoilme/art","owner":"recoilme","description":"Adaptive Radix Tree done right","archived":false,"fork":false,"pushed_at":"2022-07-22T10:26:39.000Z","size":4538,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T19:48:31.607Z","etag":null,"topics":["art","datastructures","prefix-tree","radixtree"],"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/recoilme.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":"2022-07-02T18:27:36.000Z","updated_at":"2023-05-18T14:22:54.000Z","dependencies_parsed_at":"2022-09-08T02:01:11.508Z","dependency_job_id":null,"html_url":"https://github.com/recoilme/art","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/recoilme%2Fart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recoilme%2Fart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recoilme%2Fart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recoilme%2Fart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recoilme","download_url":"https://codeload.github.com/recoilme/art/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223964485,"owners_count":17232866,"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":["art","datastructures","prefix-tree","radixtree"],"created_at":"2024-11-10T14:28:15.585Z","updated_at":"2024-11-10T14:28:16.029Z","avatar_url":"https://github.com/recoilme.png","language":"Go","readme":"# Art \nAdaptive Radix Tree done right\n\n## Simple \u0026 perfomant adaptive radix tree implementation\n\n### Description\nUnlike other implementations in Go/C this version store only different parts of keys. Which leads to dramatically reducing of memory usage in case of storing keys with repeatable fragments\n\n### Advantages\n\n - Optimized memory usage, correct implementation of compact/prefix tree\n - Minimized allocations on Set/Get (GC friendly)\n - Perfomant\n - Store the data in sorted order\n\n### Disadvantages\n \n - Binary comparator only\n\n\n### Status\nWIP\n\n### Storage format\nIn this example:\n```\n\ttree := art.New()\n\n\ttree.Set([]byte(\"http://example.com/tag/10\"), []byte(\"a\"))\n\ttree.Set([]byte(\"http://example.com/tag/20\"), []byte(\"b\"))\n\ttree.Set([]byte(\"http://some.com\"), []byte(\"c\"))\n\n\tt.Log(tree.StringKeys(true))\n```\nTree will looks like:\n```\n        key:http:// val:\n         key:example.com/tag/ val:\n          key:10 val:a\n          key:20 val:b\n         key:some.com val:c\n```\n### Benchmarks (Art vs HashMap)\n\n```\n$ go test -bench=. -benchmem -count=3 -timeout=1m  \u003e x.txt\n$ benchstat x.txt\n```\nNote: in this benchmark keys are:\n - ints - (in bigendian encodings, many common bytes)\n - words (more realistic)\n\n```\nname               time/op\nSetArt-8            115ns ±16%\nSetHashMap-8        277ns ±10%\nGetArt-8           48.5ns ± 1%\nAscendArt-8         182ns ± 8%\nDescendArt-8        401ns ± 3%\nScanArt-8           176ns ± 4%\nGetHashMap-8        116ns ± 8%\nGetWordsArt-8       155ns ± 7%\nGetWordsHashMap-8   116ns ± 7%\n\nname               alloc/op\nSetArt-8            90.0B ± 0%\nSetHashMap-8        8.00B ± 0%\nGetArt-8            0.00B     \nAscendArt-8         0.00B     \nDescendArt-8         263B ± 2%\nScanArt-8           0.00B     \nGetHashMap-8        0.00B     \nGetWordsArt-8       0.00B     \nGetWordsHashMap-8   0.00B     \n\nname               allocs/op\nSetArt-8             1.00 ± 0%\nSetHashMap-8         1.00 ± 0%\nGetArt-8             0.00     \nAscendArt-8          0.00     \nDescendArt-8         0.00     \nScanArt-8            0.00     \nGetHashMap-8         0.00     \nGetWordsArt-8        0.00     \nGetWordsHashMap-8    0.00  \n```\n\n[More benchmarks](https://github.com/recoilme/bench_sortedsets)\n\n### Usage\n\nsee tests\n\n### Credits\n\n - [The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases (Specification)](https://db.in.tum.de/~leis/papers/ART.pdf)\n\n### Author\n\n[Kulibaba Vadim](https://github.com/recoilme)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecoilme%2Fart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecoilme%2Fart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecoilme%2Fart/lists"}