Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tensorush/zig-sieve
Zig implementation of SIEVE cache eviction algorithm.
https://github.com/tensorush/zig-sieve
cache cache-algorithm eviction eviction-algorithms eviction-policy sieve sieve-cache zig zig-library zig-package ziglang
Last synced: about 18 hours ago
JSON representation
Zig implementation of SIEVE cache eviction algorithm.
- Host: GitHub
- URL: https://github.com/tensorush/zig-sieve
- Owner: tensorush
- License: mit
- Created: 2024-01-21T14:38:57.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-18T16:26:30.000Z (4 months ago)
- Last Synced: 2024-07-19T19:56:57.870Z (4 months ago)
- Topics: cache, cache-algorithm, eviction, eviction-algorithms, eviction-policy, sieve, sieve-cache, zig, zig-library, zig-package, ziglang
- Language: Zig
- Homepage: https://tensorush.github.io/zig-sieve/
- Size: 12.7 KB
- Stars: 10
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zig-sieve
[![CI][ci-shd]][ci-url]
[![CD][cd-shd]][cd-url]
[![DC][dc-shd]][dc-url]
[![LC][lc-shd]][lc-url]## Zig implementation of [SIEVE cache eviction algorithm](https://cachemon.github.io/SIEVE-website/).
### :rocket: Usage
- Add `sieve` dependency to `build.zig.zon`.
```sh
zig fetch --save https://github.com/tensorush/zig-sieve/archive/.tar.gz
```- Use `sieve` dependency in `build.zig`.
```zig
const sieve_dep = b.dependency("sieve", .{
.target = target,
.optimize = optimize,
});
const sieve_mod = sieve_dep.module("sieve");
.root_module.addImport("sieve", sieve_mod);
```### :bar_chart: Benchmarks
- Sequence: the time to cache and retrieve integer values.
```sh
$ zig build bench -- -s
Sequence: 28.833us
```- Composite: the time to cache and retrieve composite values.
```sh
$ zig build bench -- -c
Composite: 45.291us
```- Composite (normal): the time to cache and retrieve normally-distributed composite values.
```sh
$ zig build bench -- -n
Composite Normal: 135.25us
```[ci-shd]: https://img.shields.io/github/actions/workflow/status/tensorush/zig-sieve/ci.yaml?branch=main&style=for-the-badge&logo=github&label=CI&labelColor=black
[ci-url]: https://github.com/tensorush/zig-sieve/blob/main/.github/workflows/ci.yaml
[cd-shd]: https://img.shields.io/github/actions/workflow/status/tensorush/zig-sieve/cd.yaml?branch=main&style=for-the-badge&logo=github&label=CD&labelColor=black
[cd-url]: https://github.com/tensorush/zig-sieve/blob/main/.github/workflows/cd.yaml
[dc-shd]: https://img.shields.io/badge/click-F6A516?style=for-the-badge&logo=zig&logoColor=F6A516&label=docs&labelColor=black
[dc-url]: https://tensorush.github.io/zig-sieve
[lc-shd]: https://img.shields.io/github/license/tensorush/zig-sieve.svg?style=for-the-badge&labelColor=black
[lc-url]: https://github.com/tensorush/zig-sieve/blob/main/LICENSE