https://github.com/tensorush/zig-sieve
Zig implementation of SIEVE cache eviction algorithm.
https://github.com/tensorush/zig-sieve
sieve-cache zig-package
Last synced: 3 months 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-04T13:56:21.000Z (4 months ago)
- Last Synced: 2025-03-23T03:08:22.695Z (4 months ago)
- Topics: sieve-cache, zig-package
- Language: Zig
- Homepage: https://tensorush.github.io/zig-sieve/
- Size: 17.6 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zig-sieve
## Zig implementation of [SIEVE cache eviction algorithm](https://cachemon.github.io/SIEVE-website/).
### Usage
- Add `sieve` dependency to `build.zig.zon`.
```sh
zig fetch --save git+https://github.com/tensorush/zig-sieve
```- 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);
```### Benchmarks (MacBook M1 Pro)
- Sequence: the time to cache and retrieve integer values.
```sh
$ zig build bench -- -s
Sequence: 23.042us
```- Composite: the time to cache and retrieve composite values.
```sh
$ zig build bench -- -c
Composite: 33.417us
```- Composite (normal): the time to cache and retrieve normally-distributed composite values.
```sh
$ zig build bench -- -n
Composite Normal: 99.708us
```