{"id":18520610,"url":"https://github.com/nerett/hwc-cache","last_synced_at":"2025-05-14T17:13:26.719Z","repository":{"id":196370022,"uuid":"538671401","full_name":"nerett/hwc-cache","owner":"nerett","description":"C++ LFU cache implementation","archived":false,"fork":false,"pushed_at":"2023-04-01T19:20:47.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T05:14:34.545Z","etag":null,"topics":["cache","cpp20","lfu-cache"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nerett.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}},"created_at":"2022-09-19T19:46:05.000Z","updated_at":"2023-03-28T20:39:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b202366-60d4-4a90-a10c-7aa0b9297883","html_url":"https://github.com/nerett/hwc-cache","commit_stats":null,"previous_names":["nerett/hwc-cache"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerett%2Fhwc-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerett%2Fhwc-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerett%2Fhwc-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerett%2Fhwc-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerett","download_url":"https://codeload.github.com/nerett/hwc-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190431,"owners_count":22029636,"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":["cache","cpp20","lfu-cache"],"created_at":"2024-11-06T17:21:27.532Z","updated_at":"2025-05-14T17:13:26.699Z","avatar_url":"https://github.com/nerett.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HWC-Cache\nThis is *LFU (least frequently used)* cache emulation written in *C++*. This type of cache stores memory pages with high hit rate and replaces pages with low frequency with the new ones in case there is not enough free space to fit them both. Cached pages have low access time and others are loaded with slow lookup method provided by user.\n\n## Usage\nYou're expected to type the following on startup (see [Running](https://github.com/nerett/hwc-cache/blob/main/README.md#running) section for more):\n\n```bash\n\u003ccachesize\u003e \u003cnumber of keys\u003e\n\u003ckey1\u003e \u003ckey2\u003e \u003ckey3\u003e \u003cetc\u003e\n```\n\n`cachesize` stands for the cache maximum capacity, `number of keys` - number of cache read attempts, `keyn` - id of the page to be red in current read iteration. After you're done, `hwc-cache` will simulate the process and display just one value - number of cache hits for current algorithm.\n\n## Building from source\n#### Downloading\nDownload this repository with\n\n```bash\ngit clone https://github.com/nerett/hwc-cache.git\n```\n\n#### Installing dependencies\nInstall required packages automatically with\n\n```bash\nmake install-dependencies-pkg PACKAGEMANAGER=\u003cyour-package-manager-name\u003e #apt is used if PACKAGEMANAGER is not defined\n```\n\n...or install them manually with your distro package manager (check list [here](https://github.com/nerett/hwc-cache#Dependencies)).\n\n#### Building\nBuild `hwc-cache` as a standalone program with\n\n```bash\nmake MODE=DEBUG #or MODE=RELEASE; MODE=RELEASE if not defined\n```\n\n#### Running\nYou can run builded release/debug version of standalone `hwc-cache` with\n\n```bash\nmake run-lfu MODE=DEBUG #MODE=RELEASE if MODE is not defined\n```\n\nUse `rund` instead of `run` to run with `valgrind`\n\n...or run this binary with manually from project directory.\n\n#### Testing\nThere are built-in end-to-end test. You can run current test pack for LFU cache with\n\n```bash\nmake test-lfu\n```\n\n##### You'll see something like this:\n![example-e2etest](https://user-images.githubusercontent.com/89396128/229309895-9efe30c7-0a29-4753-9d8d-dc0b4c135ef0.png)\n\n\nTest pack for FLU cache is located in `test/lfu_testdata/`. There are 2 types of files: `*.in` for input data and `*.exp` for expected result. All of these files are scanned automatically on startup and added to the current test sequence.\n\n#### Rebuilding\nTo totally rebuild the project run\n\n```bash\nmake clean\nmake MODE=\u003cmodename\u003e\n```\n\n\n## Dependencies\nThis project actually depends on `libc` and building requires `make`, `g++` and `git` (it can also require `valgrind` installed to use `rund` target).\n\n## Documentation\nThis section isn't done yet.\n\n## About project\nThis program was written during MIPT **Vladimirov's** cource.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerett%2Fhwc-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerett%2Fhwc-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerett%2Fhwc-cache/lists"}