{"id":15973409,"url":"https://github.com/al8n/caches-rs","last_synced_at":"2025-04-05T17:09:46.494Z","repository":{"id":46720026,"uuid":"398790772","full_name":"al8n/caches-rs","owner":"al8n","description":"This is a Rust implementation for popular caches (support no_std).","archived":false,"fork":false,"pushed_at":"2024-05-04T04:03:22.000Z","size":231,"stargazers_count":104,"open_issues_count":4,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-08T21:04:48.448Z","etag":null,"topics":["2q-cache","arc-cache","cache","lfu","lfu-cache","lru","lru-cache","rust","rust-lang","rust-lru","tinylfu"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/al8n.png","metadata":{"files":{"readme":"README-zh_CN.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":"al8n","patreon":"al8n"}},"created_at":"2021-08-22T12:10:56.000Z","updated_at":"2024-08-19T03:08:44.000Z","dependencies_parsed_at":"2023-10-17T06:36:08.584Z","dependency_job_id":"0f7d8353-4ef9-4efe-a89f-63e2eb78bc20","html_url":"https://github.com/al8n/caches-rs","commit_stats":{"total_commits":57,"total_committers":5,"mean_commits":11.4,"dds":"0.10526315789473684","last_synced_commit":"5a9eb4031e6414aa5450c16f7cae59a29e78d94e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fcaches-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fcaches-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fcaches-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fcaches-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/al8n","download_url":"https://codeload.github.com/al8n/caches-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369954,"owners_count":20927928,"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":["2q-cache","arc-cache","cache","lfu","lfu-cache","lru","lru-cache","rust","rust-lang","rust-lru","tinylfu"],"created_at":"2024-10-07T21:04:49.092Z","updated_at":"2025-04-05T17:09:46.445Z","avatar_url":"https://github.com/al8n.png","language":"Rust","funding_links":["https://github.com/sponsors/al8n","https://patreon.com/al8n"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eCaches\u003c/h1\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/GITHUB-caches--rs-8da0cb?style=for-the-badge\u0026logo=Github\" height=\"22\"\u003e][Github-url]\n[\u003cimg alt=\"Build\" src=\"https://img.shields.io/badge/Build-passing-brightgreen?style=for-the-badge\u0026logo=Github-Actions\" height=\"22\"\u003e][CI-url]\n[\u003cimg alt=\"codecov\" src=\"https://img.shields.io/codecov/c/gh/al8n/caches-rs?style=for-the-badge\u0026token=65Q9QTR99U\u0026logo=codecov\" height=\"22\"\u003e][codecov-url]\n\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-caches-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K\" height=\"20\"\u003e][doc-url]\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/caches?logo=rust\u0026style=for-the-badge\" height=\"22\"\u003e][crates-url]\n[\u003cimg alt=\"license-apache\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge\u0026logo=Apache\" height=\"22\"\u003e][license-apache-url]\n[\u003cimg alt=\"license-mit\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge\u0026fontColor=white\u0026logoColor=f5c076\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzZweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMzZweCIgZmlsbD0iI2Y1YzA3NiI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEwLjA4IDEwLjg2Yy4wNS0uMzMuMTYtLjYyLjMtLjg3cy4zNC0uNDYuNTktLjYyYy4yNC0uMTUuNTQtLjIyLjkxLS4yMy4yMy4wMS40NC4wNS42My4xMy4yLjA5LjM4LjIxLjUyLjM2cy4yNS4zMy4zNC41My4xMy40Mi4xNC42NGgxLjc5Yy0uMDItLjQ3LS4xMS0uOS0uMjgtMS4yOXMtLjQtLjczLS43LTEuMDEtLjY2LS41LTEuMDgtLjY2LS44OC0uMjMtMS4zOS0uMjNjLS42NSAwLTEuMjIuMTEtMS43LjM0cy0uODguNTMtMS4yLjkyLS41Ni44NC0uNzEgMS4zNlM4IDExLjI5IDggMTEuODd2LjI3YzAgLjU4LjA4IDEuMTIuMjMgMS42NHMuMzkuOTcuNzEgMS4zNS43Mi42OSAxLjIuOTFjLjQ4LjIyIDEuMDUuMzQgMS43LjM0LjQ3IDAgLjkxLS4wOCAxLjMyLS4yM3MuNzctLjM2IDEuMDgtLjYzLjU2LS41OC43NC0uOTQuMjktLjc0LjMtMS4xNWgtMS43OWMtLjAxLjIxLS4wNi40LS4xNS41OHMtLjIxLjMzLS4zNi40Ni0uMzIuMjMtLjUyLjNjLS4xOS4wNy0uMzkuMDktLjYuMS0uMzYtLjAxLS42Ni0uMDgtLjg5LS4yMy0uMjUtLjE2LS40NS0uMzctLjU5LS42MnMtLjI1LS41NS0uMy0uODgtLjA4LS42Ny0uMDgtMXYtLjI3YzAtLjM1LjAzLS42OC4wOC0xLjAxek0xMiAyQzYuNDggMiAyIDYuNDggMiAxMnM0LjQ4IDEwIDEwIDEwIDEwLTQuNDggMTAtMTBTMTcuNTIgMiAxMiAyem0wIDE4Yy00LjQxIDAtOC0zLjU5LTgtOHMzLjU5LTggOC04IDggMy41OSA4IDgtMy41OSA4LTggOHoiLz48L3N2Zz4=\" height=\"22\"\u003e][license-mit-url]\n\nThis is a Rust implementation for popular caches (support no_std).\n\nSee [Introduction](#introduction), [Installation](#installation) and [Usages](#usages) for more details.\n\n[English](README.md) | 简体中文\n\n\u003c/div\u003e\n\n## Introduction\n\nThe MSRV for this crate is 1.55.0.\n\n- LRU\n  - `LRUCache`, `SegmentedCache`, `TwoQueueCache` and `AdaptiveCache`.\n- LFU\n  - `TinyLFU`, `SampledLFU`, and `WTinyLFUCache`\n\n## Installation\n\n- std\n\n    ```toml\n    [dependencies]\n    caches = \"0.3\" \n    ```\n\n- no_std\n\n    ```toml \n    [dependencies]\n    caches = { version = \"0.3\", default-features = false, features = [\"libm\", \"hashbrown\"] }\n    ```\n\n## Usages\nPlease see [`examples`].\n\n## Acknowledgments\n- The implementation of `RawLRU` is highly inspired by\n  [Jerome Froelich's LRU implementation](https://github.com/jeromefroe/lru-rs)\n  and [`std::collections`] library of Rust.\n\n- Thanks for [HashiCorp's golang-lru](https://github.com/hashicorp/golang-lru)\n  providing the amazing Go implementation.\n\n- Ramakrishna's paper: [Caching strategies to improve disk system performance]\n\n- The implementation of TinyLFU and SampledLFU are inspired by [Dgraph's ristretto] and dgryski's [go-tinylfu].\n\n- Gil Einziger's paper: [TinyLFU: A Highly Efficient Cache Admission Policy]\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this project by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n\n[`Rc`]: https://doc.rust-lang.org/std/rc/struct.Rc.html\n[`Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html\n[`mem::swap`]: https://doc.rust-lang.org/stable/std/mem/fn.swap.html\n[`std::collections`]: https://doc.rust-lang.org/stable/std/collections/\n[Github-url]: https://github.com/al8n/caches-rs/\n[CI-url]: https://github.com/al8n/caches-rs/actions/workflows/ci.yml\n[codecov-url]: https://codecov.io/gh/al8n/caches-rs\n[license-apache-url]: https://opensource.org/licenses/Apache-2.0\n[license-mit-url]: https://opensource.org/licenses/Apache-2.0\n[crates-url]: https://crates.io/crates/caches\n[doc-url]: https://docs.rs/caches\n[documents]: https://docs.rs/caches\n[Caching strategies to improve disk system performance]: https://dl.acm.org/doi/10.1109/2.268884\n[go-tinylfu]: https://github.com/dgryski/go-tinylfu\n[Dgraph's ristretto]: https://github.com/dgraph-io/ristretto/blob/master/policy.go\n[TinyLFU: A Highly Efficient Cache Admission Policy]: https://arxiv.org/pdf/1512.00727.pdf\n[`examples`]: https://github.com/al8n/caches-rs/tree/main/examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal8n%2Fcaches-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal8n%2Fcaches-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal8n%2Fcaches-rs/lists"}