{"id":21814314,"url":"https://github.com/snawoot/freelist","last_synced_at":"2025-04-13T23:46:24.510Z","repository":{"id":256657890,"uuid":"855325046","full_name":"Snawoot/freelist","owner":"Snawoot","description":"Pure Go generic implementation of freelist allocator","archived":false,"fork":false,"pushed_at":"2024-09-16T14:42:05.000Z","size":45,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T13:51:22.954Z","etag":null,"topics":["freelist","malloc","malloc-library","memory-allocation","memory-management"],"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-09-10T17:23:53.000Z","updated_at":"2024-12-26T11:59:51.000Z","dependencies_parsed_at":"2024-09-16T16:54:06.369Z","dependency_job_id":null,"html_url":"https://github.com/Snawoot/freelist","commit_stats":null,"previous_names":["snawoot/freelist"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Ffreelist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Ffreelist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Ffreelist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Ffreelist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snawoot","download_url":"https://codeload.github.com/Snawoot/freelist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799695,"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":["freelist","malloc","malloc-library","memory-allocation","memory-management"],"created_at":"2024-11-27T14:37:37.650Z","updated_at":"2025-04-13T23:46:24.477Z","avatar_url":"https://github.com/Snawoot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# freelist\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/Snawoot/freelist.svg)](https://pkg.go.dev/github.com/Snawoot/freelist)\n\nPure Go generic implementation of freelist allocator.\n\nIt allows faster allocation and reuse of small objects, making some implementations of datastructures (linked lists, trees, ...) significantly more efficient.\n\nKey features:\n\n* Unlike many other implementations, it doesn't ruin garbage collection for pointers inside allocated objects and plays nicely with garbage collector.\n* Unlike many other implementations, it doesn't depend on CGO and doesn't encumber builds.\n\n## Usage\n\nSee [godoc examples](https://pkg.go.dev/github.com/Snawoot/freelist#pkg-examples).\n\n## Benchmarks\n\nHere is benchmarks of original `container/list.List` (`BenchmarkContainerList.*`) versus the same List, but augmented by this freelist package (`BenchmarkFreelistList.*`).\n\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/Snawoot/freelist\ncpu: Intel(R) N100\nBenchmarkContainerList/PushFront-4                     \t10498634\t        138.6 ns/op\t      55 B/op\t       1 allocs/op\nBenchmarkContainerList/PushPopFront-4                  \t 9171722\t        173.3 ns/op\t      55 B/op\t       1 allocs/op\nBenchmarkContainerList/PushPopFrontImmediate-4         \t14392966\t        97.04 ns/op\t      56 B/op\t       1 allocs/op\nBenchmarkFreelistList/PushFront-4                      \t13464580\t        89.79 ns/op\t      56 B/op\t       1 allocs/op\nBenchmarkFreelistList/PushPopFront-4                   \t12886014\t        82.59 ns/op\t      56 B/op\t       1 allocs/op\nBenchmarkFreelistList/PushPopFrontImmediate-4          \t30983012\t        38.41 ns/op\t       8 B/op\t       0 allocs/op\nBenchmarkFreelistList/WarmedUpPushFront-4              \t36359986\t        32.00 ns/op\t       7 B/op\t       0 allocs/op\nBenchmarkFreelistList/WarmedUpPushPopFront-4           \t31587457\t        38.25 ns/op\t       7 B/op\t       0 allocs/op\nBenchmarkBuiltinNew-4                                  \t48650766\t        27.10 ns/op\t       8 B/op\t       1 allocs/op\nBenchmarkFreelistAlloc-4                               \t68139662\t        16.94 ns/op\t      18 B/op\t       0 allocs/op\nBenchmarkWarmedUpFreelistAlloc-4                       \t224581018\t        5.377 ns/op\t       0 B/op\t       0 allocs/op\nPASS\nok  \tgithub.com/Snawoot/freelist\t28.662s\n```\n\nAs you can see it performs about twice faster than original `container/list.List` in worst case and performs 3-5 times faster once freelist reaches right size.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnawoot%2Ffreelist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnawoot%2Ffreelist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnawoot%2Ffreelist/lists"}