{"id":20605963,"url":"https://github.com/topliceanu/cache","last_synced_at":"2026-04-17T18:32:22.763Z","repository":{"id":145450833,"uuid":"268498119","full_name":"topliceanu/cache","owner":"topliceanu","description":"Implementations of various cache replacement algorithms","archived":false,"fork":false,"pushed_at":"2020-06-22T18:34:35.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T20:22:42.978Z","etag":null,"topics":["arc","cache","lfru-cache","lfu-cache","lru-cache","mru-cache","slru-cache"],"latest_commit_sha":null,"homepage":"http://alexandrutopliceanu.ro","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/topliceanu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-06-01T11:04:26.000Z","updated_at":"2020-06-22T18:34:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"9aaec2a7-1917-4e88-a413-f7cb5309c855","html_url":"https://github.com/topliceanu/cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/topliceanu/cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topliceanu%2Fcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topliceanu%2Fcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topliceanu%2Fcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topliceanu%2Fcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topliceanu","download_url":"https://codeload.github.com/topliceanu/cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topliceanu%2Fcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31940826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["arc","cache","lfru-cache","lfu-cache","lru-cache","mru-cache","slru-cache"],"created_at":"2024-11-16T09:31:53.102Z","updated_at":"2026-04-17T18:32:22.747Z","avatar_url":"https://github.com/topliceanu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cache\n\n![gh actions status](https://github.com/topliceanu/cache/workflows/CI%20Workflow/badge.svg)\n\nThis repository contains example implementation of various cache replacement strategies.\nIt accompanies this blog post [Cache replacement strategies](http://alexandrutopliceanu.ro/)\n\n## Notice\n\nDo not use these implementations for production workloads, they are not thread-safe and only support `int` keys and values.\nThey are meant for educational and experimentation purposes.\nHowever feel free to get inspiration from the source code when designing your own cache system for your use-case.\n\n## Contents\n\nThere are current six algorithms implemented in this repository as well as tests and benchmarks for them.\n\nThe interface of the package is intentionally left small to allow for more flexibility.\nSee [godoc](https://godoc.org/github.com/topliceanu/cache).\nAll algorithms implement the `Cache` interface.\nTo keep it simple, the only supported type for keys and values is `int`. This may be extended in the future.\nTo get an instance of a cache implementation, you need to use the `Factory` function.\n\n## Build\n\n```bash\n$ ./script/build\n```\n\n## Tests\n\n```bash\n$ ./script/test\n```\n\n## Lint\n\n```bash\n$ ./script/lint\n```\n\n## Benchmark\n\n```bash\n$ ./script/benchmark\n```\n\nCalculate hit-rates with random input stream\n\n```bash\n$ go run ./cmd/hit-rate/main.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopliceanu%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopliceanu%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopliceanu%2Fcache/lists"}